2017年11月6日

摘要: #include using namespace std; int jc(int num){ int a; if(num==1) a=1; else a=jc(num-1)*num; return a; } int main(){ int b=8; cout<<jc(8)<<endl; return 0; } 阅读全文
posted @ 2017-11-06 22:26 三叶癌 阅读(129) 评论(0) 推荐(0) 编辑
摘要: #include 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; return 0; } 阅读全文
posted @ 2017-11-06 22:22 三叶癌 阅读(89) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int main(){ int a,b,c,d,max; cout>a>>b>>c>>d; max=a>=b?a:b; max=max>=c?max:c; max=max>=d?max:d; cout using namespace std; int max2(int p,int o,i... 阅读全文
posted @ 2017-11-06 22:19 三叶癌 阅读(94) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int sum(int x,int y); int main(){ int a,b,s; cout>a>>b; s=sum(a,b); cout<<"the sum of a and b"<<s<<endl; return 0; } int sum(int x,int y){ ... 阅读全文
posted @ 2017-11-06 21:38 三叶癌 阅读(77) 评论(0) 推荐(0) 编辑

导航