摘要: #includeint main(){ int i,n; double r,v,h; double cylinder(double r,double h); printf("enter n:"); scanf("%d",&n); for(i=1;i<=n;i++){ printf("Enter r and h:"); scanf("%lf%lf",&r,&h); if((r<=0)||(h<=0)) { printf("输入错误,重新输入\n"); } 阅读全文
posted @ 2013-10-14 09:50 执于一念 阅读(167) 评论(0) 推荐(0) 编辑
摘要: #includeint main(){ double r,s; printf("enter r:"); scanf("%lf",&r); if(r>0){ s=3.14159*r*r; printf("s=%.3f\n",s); } else printf("输入错误"); return 0;} 阅读全文
posted @ 2013-10-14 09:15 执于一念 阅读(142) 评论(0) 推荐(0) 编辑