摘要:
#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:\n");/*利用循环来求出多组解*/ scanf("%lf%lf",&r,&h); if((r<=0)||(h<=0)) { printf(&q 阅读全文
摘要:
#includeint main(void){ double radius,area;/*定义两个变量*/ printf("Enter r:"); scanf("%Lf",&radius); if(radius<=0){ printf("输入错误"); } else{ area=3.1415926*radius*radius; printf("Area=%.3f\n",area); } return 0;} 阅读全文