sanf("%f",&r);
sanf("%f",&h);
v=s;
#include
#include
#define PI 3.14159
int main(void)
{
float r,h,V=0;
printf("Please input r= ?h= ?\n");
loop: scanf("%f %f",&r,&h);
if(r<=0 || h<=0)
{
printf("Please input again:\n");
goto loop;
}
V=PI*pow(r,2)*h;
printf("%.4f\n",V);
return 0;
}
编译通过 成功判断
scanf("%d",r);
scanf("%d",h);