引导语:每个人都有孤独的时候,要学会忍受孤独,这样才会成熟起来。不要因为寂寞而乱了方寸,而去做无聊无益的事情,白白浪费了宝贵的时间。世界顶级精英们的人生哲学,很有道理。 1.别为你自己和别人下定论,你所看到听到的可能只是一面,为这个失去可能的朋友,很不值。 2.你可以有喝醉的时候,我们可以接受,但是你要明白和真正的朋友一醉才能让伤心事方休,否则,你只会是别人的谈资和笑柄。 3.如果你的个性让很多人对你敬而...
欢迎!朋友。
#include <iostream> using namespace std; int myFunc(int,int); //用递归的方式计算指数次幂 int main() { int x,y,z,a,b; cout<<“请输入两个数,例如x和y,程序计算他们的指数次幂。”<<“n”<<“第一个数:”; cin>>x; cout<<“第二个数:”; cin>>y; a=x; b=y; z=myFunc(x,y); cout<<a<<“的”<<b<<“次方是”<<z<<endl; return 0; } int myFunc(int x,int y) { if (y=...
//函数的递归 #include <iostream> using namespace std; int fib(int n); int main() { int n,answer; cout<<“Enter Number to find:”; cin>>n; cout<<“nn”; answer=fib(n); cout<<answer<<” is the “<<n; cout<<“th Fibonacci numbern”; return 0; } int fib(int n) { cout<<“Processing fib(“<<n<<“)…”; if(n<3) { cout<<“Return 1!n”; re...
#include <iostream> using namespace std; int Double(int); long Double(long); float Double(float); double Double(double); int main() { int myInt = 6500; long myLong = 65000; float myFloat = 6.5f; double myDouble = 6.5e20; int doubledInt; long doubledLong; float doubledFloat; double doubledDouble; cout<<“myInt:”<<myInt<<endl; cout<<“myLong:”<<myLong<<endl; cout<<“myFloat:”<<myFloat<<endl...
#include <iostream> void main() { typedef unsigned short int USI; const USI Sunday = 0; const USI Monday = 1; const USI Tuesday = 2; const USI Wednesday = 3; const USI Thursday = 4; const USI Friday = 5; const USI Saturday = 6; USI Today = Sunday; if (Today == Sunday || Today == Saturday) std::cout << “nGotta Weekends!n”; else std::cout << “nGo to work!n”; } #include <iostream> int main() { enum Days {Sunday,Monday,Tuesday,Wednes...
#include <iostream> int main() { for (unsigned char i = 32;i<128;i++) std::cout << i; std::cout << std::endl; return 0; }
#include <iostream> int main() { for (int i = 32;i < 128;i++) std::cout << (char) i; std::cout << std::endl; return 0; }
#include <iostream> int main() { using std::cout; using std::endl; short int smallNumber; smallNumber = 32767; cout << “smallNumber : ” << smallNumber << endl; smallNumber++; cout << “smallNumber : ” << smallNumber << endl; smallNumber++; cout << “smallNumber : ” << smallNumber << endl; smallNumber++; cout << “smallNumber : ” << smallNumber << endl; sma...