摘要:
#includeint 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("Voume=%.3f\n",volume); return 0;}double cylinder(double r,double 阅读全文
posted @ 2013-10-04 18:44
zhaoyang16
阅读(183)
评论(0)
推荐(0)
摘要:
#includeint main(void){ int child,men,women; for(men=0;men<=45;men++) for(women=0;women<=45;women++) for(child=0;child<=45;child++) if(men+women+child==45&&men*3+women*2+child*0.5==45) printf("men=%d,women=%d,child=%d\n",men,women,child); return 0;} 阅读全文
posted @ 2013-10-04 18:42
zhaoyang16
阅读(104)
评论(0)
推荐(0)
摘要:
#includeint 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-04 18:41
zhaoyang16
阅读(89)
评论(0)
推荐(0)
摘要:
#includeint main(void){ int i,x1,x2,x; x1=1; x2=1; 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-04 18:39
zhaoyang16
阅读(110)
评论(0)
推荐(0)
摘要:
#includeint main(void){ int x; printf("Enter x:"); scanf("%d",&x); while(x!=0){ printf("%d",x%10); x=x/10; } return 0;} 阅读全文
posted @ 2013-10-04 18:28
zhaoyang16
阅读(125)
评论(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");} 阅读全文
posted @ 2013-10-04 18:27
zhaoyang16
阅读(126)
评论(0)
推荐(0)
摘要:
# includeint main(void){ int i,mark,max,n; printf("Enter n:"); scanf("%d",&n); printf("Enter %d marks:",n); scanf("%d",&mark); max=mark; for(i=1;i<n;i++){ scanf("%d",&mark); if(max<mark) max=mark; } printf("Max=%d\n",max); 阅读全文
posted @ 2013-10-04 18:26
zhaoyang16
阅读(98)
评论(0)
推荐(0)
摘要:
#includeint main(void){ int mark,max; printf("Enter marks:"); scanf("%d",&mark); max=mark; while(mark>=0){ if(max<mark) max=mark; scanf("%d",&mark); }; printf("Max=%d\n",&max); return 0;} 阅读全文
posted @ 2013-10-04 18:25
zhaoyang16
阅读(91)
评论(0)
推荐(0)
摘要:
#includeint main(void){ int i,j; double item,sum; sum=0; for(i=1;i<=100;i++){ item=1; for(j=1;j<=i;j++) item=item*j; sum=sum+item; } printf("1!+2!+...+100!=%e\n",sum); return 0;} 阅读全文
posted @ 2013-10-04 18:23
zhaoyang16
阅读(90)
评论(0)
推荐(0)
摘要:
#includedouble fact (int n);int main(void){ int i; double sum; sum=0; for(i=1;i<=100;i++) sum=sum+fact(i); printf("1!+2!+...+100!=%e\n",sum); return 0;}double fact(int n){ int i; double result; result=1; for(i=1;i<=n;i++) result=result*i; return result;} 阅读全文
posted @ 2013-10-04 18:16
zhaoyang16
阅读(125)
评论(0)
推荐(0)

浙公网安备 33010602011771号