11 2017 档案

3*4的矩阵,编程求出其中最大值,以及其所在的行号和列号。
摘要:#include using namespace std; int main(){ int array[3][4]={{1,46,98,-4}, {45,22,-75,0}, {456,498,35,4}}; int unknow=array[0][0]; int h=0; int l=0; for... 阅读全文

posted @ 2017-11-27 21:34 三叶癌 阅读(461) 评论(0) 推荐(0)

斐波纳契数列 Fibonacci
摘要:使用一位数组解决 1 1 2 3 5 8 13 数列问题 阅读全文

posted @ 2017-11-20 20:20 三叶癌 阅读(121) 评论(0) 推荐(0)

冒泡数组排序
摘要:#include using namespace std; int main(){ int arr[10]={6,98,498,56,43,646,894,46,8,89}; for (int i=0;iarr[j+1]){ int re; re=arr[j]; ... 阅读全文

posted @ 2017-11-16 20:42 三叶癌 阅读(90) 评论(0) 推荐(0)

函数模板
摘要:#include using namespace std; template T max(T x ,T y,T z){ if(z>x) x=z; if(y>x) x=y; return x; } int main(){ int a,b,c,m; cin>>a>>b>>c; m=max(a,b,c); cout>ac>>bc... 阅读全文

posted @ 2017-11-09 20:49 三叶癌 阅读(124) 评论(0) 推荐(0)

重载
摘要:#include using namespace std; int m(int x,int y,int z); short m(short q,short w,short e); double m(double a,double s,double d); int main(){ int a,b,c,min; cin>>a>>b>>c; min=m(a,b,c); ... 阅读全文

posted @ 2017-11-09 20:41 三叶癌 阅读(115) 评论(0) 推荐(0)

inline 内联
摘要:#include using namespace std; int m(int x,int y,int z); int main(){ int a,b,c,max; cin>>a>>b>>c; max=m(a,b,c); coutx) x=z; if(y>x) x=y; return x; } ... 阅读全文

posted @ 2017-11-09 20:19 三叶癌 阅读(81) 评论(0) 推荐(0)

11.1work
摘要:#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 三叶癌 阅读(132) 评论(0) 推荐(0)

10.31 work
摘要:#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 三叶癌 阅读(91) 评论(0) 推荐(0)

10.24 work 2
摘要:#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 三叶癌 阅读(100) 评论(0) 推荐(0)

10.24 work
摘要:#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 三叶癌 阅读(81) 评论(0) 推荐(0)

导航