摘要: #include <iostream> using namespace std; int age(int num){ int a; if(num==1) a=10; else a=age(num-1)+2; return a; } int main(){ cout<<age(5)<<endl; re 阅读全文
posted @ 2017-11-06 22:20 LemonSir 阅读(71) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int jiecheng(int num){ int f; if(num==1) f=1; else f=jiecheng(num-1)*num; return f; } int main(){ int n=5; cout<<jiecheng(n)<<endl; ... 阅读全文
posted @ 2017-11-06 22:19 LemonSir 阅读(54) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <iomanip> using namespace std; int main(){ double d=97.123456789012345; double dou=205.123456; double doub=123456.007; co 阅读全文
posted @ 2017-11-06 21:47 LemonSir 阅读(84) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <iomanip> using namespace std; int main(){ double a=123.456,b=3.14159,c=-3214.67; cout<<setiosflags(ios::fixed)<<setiosfl 阅读全文
posted @ 2017-11-06 21:45 LemonSir 阅读(68) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; int main(){ cout<<(6&3)<<endl; return 0; } 阅读全文
posted @ 2017-09-25 23:50 LemonSir 阅读(54) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; int main(){ short int k=2; k+=1; cout<<k<<endl; return 0; } 阅读全文
posted @ 2017-09-25 23:49 LemonSir 阅读(42) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int main(){ int a=7,b; b=a++; cout using namespace std; int main(){ int a=7,b; b=++a; cout<<b<<endl; return 0; } 阅读全文
posted @ 2017-09-25 23:40 LemonSir 阅读(64) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int main(){ int a=11,b=1,c; while(a>0,b using namespace std; int main(){ for (int a=1;a<=11;a++){ if(a%2==1) cout<<a<<endl; } return... 阅读全文
posted @ 2017-09-25 23:34 LemonSir 阅读(82) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; int main(){ int x=8999; int value=x*1000/1000; cout<<"value="<<value<<endl; return 0; } 阅读全文
posted @ 2017-09-25 23:32 LemonSir 阅读(118) 评论(2) 推荐(0) 编辑