这个什么循环判断都不要一个输入一个输出就是啊,scanf("%d%d",&r,&h);printf("%d%d",3.14*2*r*h+2*3.14*r*r,3.14*r*r*h);
#include "stdafx.h"
#include "stdio.h"
#include "conio.h"
#define PI 3.141592653589793
double surfaceArea(float r,float h){
return 2*PI*r*(r+h);
}
double volume(float r,float h){
return PI*r*r*h;
}
void main()
{
double r = 0,h = 0;
puts("input r and h:");
scanf("%f%f",&r,&h);
printf("surfaceArea = %f \n",surfaceArea(r, h));
printf("volume = %f \n",volume(r, h));
puts("\npress any key to exit.");
getch();
}
#define PI 3.14
#include
main()
{ float r,h,S,V;
S=2*PI*r*(h+r);
V=2*PI*r*h*h;
please input r,h: scanf("%f,%f",&r,&h);
printf("S=%f,V=%f ",S,V);
getch();
}