上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页
摘要: #include float cash; int main(void) { int choice; float value; void income(float number),expend(float number);cash=0; printf("Enter operate choice(0--end,1--income,2--expend):"); scanf("%d",&choice); while(choice!=0){ if(choice==1||choice==2){ printf("Enter cash value:&q 阅读全文
posted @ 2013-10-07 09:40 dihuanting 阅读(99) 评论(0) 推荐(0) 编辑
摘要: int x; int f(); int main(void) { int a=1;x=a; a=f(); { int b=2; b=a+b; x=x+b;} printf("%d%d",a,x);return 0; }int f() { int x=4;return x; } 阅读全文
posted @ 2013-10-07 09:13 dihuanting 阅读(118) 评论(0) 推荐(0) 编辑
摘要: #include float result_real,result_imag;int main(void) { float imag1,imag2,real1,real2;void complex_prod(float real1,float imag1,float real2,float imag2); void complex_add(float real1,float imag1,float real2,float imag2);printf("Enter 1st complex number(real and imaginary):"); scanf("% 阅读全文
posted @ 2013-10-07 09:05 dihuanting 阅读(120) 评论(0) 推荐(0) 编辑
摘要: #include int main(void) { void pyramid(int n);pyramid(5);return 0; } void pyramid(int n) { int i,j;for(i=1;i<=n;i++){ for(j=1;j<=n-i;j++) printf(" "); for(j=1;j<=i;j++) printf("%d",i); putchar('\n'); } } 阅读全文
posted @ 2013-10-06 22:51 dihuanting 阅读(94) 评论(0) 推荐(0) 编辑
摘要: #include #include int main(void) { int count,m; int prime(int m);count=0; for(m=2;m<=100;m++){ if(prime(m)!=0){ printf("%6d",m); count++; if(count%10==0) printf("f\n"); } } printf("\n"); } int prime(int m) { int i,n;if(m==1)return 0; n=sqrt(m); for(i=2;i<=n;i++) i 阅读全文
posted @ 2013-10-06 22:27 dihuanting 阅读(91) 评论(0) 推荐(0) 编辑
摘要: #include #include int main(void) { double e,pi; double funpi(double e); printf("Enter e:"); scanf("%lf",&e); pi=funpi(e); printf("pi=%f\n",pi); return 0; }double funpi(double e) { int denominator,flag; double item,sum;flag=1; denominator=1; item=1.0; sum=0; while(fa 阅读全文
posted @ 2013-10-06 22:15 dihuanting 阅读(112) 评论(0) 推荐(0) 编辑
摘要: #include int main(void) { double height,radius,volume; double cylinder(double r,double h);printf("Enter radius and height:"); scanf("%lf%lf",&radius,&height); volume=cylinder(radius,height); printf("Volume=%.3f\n",volume);return 0; } double cylinder(double r,dou 阅读全文
posted @ 2013-10-06 22:03 dihuanting 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 程序1 #include int main(void) { int child,men,women;for(men=0;men int main(void) { int child,women,men;for(men=0;men<=15;men++) for(women=0;women<=22;women++){ child=45-women-men; if(men*3+women*2+child*0.5==45) printf("men=%d,women=%d,child=%d\n",men,women,child); } return 0; } 阅读全文
posted @ 2013-10-06 21:25 dihuanting 阅读(113) 评论(0) 推荐(0) 编辑
摘要: #include int main(void) { int i,x1,x2,x;x1=1; x2=2; printf("%6d%6d",x1,x2); for(i=1;i<=8;i++){ x=x1+x2;printf("%6d",x); x1=x2; x2=x; } printf("\n");return 0; } 阅读全文
posted @ 2013-10-06 21:10 dihuanting 阅读(96) 评论(0) 推荐(0) 编辑
摘要: #include #includeint main(void) { int count,i,m,n;count=0; for(m=2;mn){ printf("%6d",m); count++; if(count % 10==0) printf("\n"); } } printf("\n");return 0;} 阅读全文
posted @ 2013-10-06 21:05 dihuanting 阅读(83) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页