C语言编程 输入圆的半径 r ,计算圆的周长和面积 .其中 π =3.1416#define PI 3.1416;#include"stdio.h"int main(){float r,s,c;scanf("%f",&r);c=2*PI*r;s=PI*r*r;printf("%6.2f,%6.2f\n",s,c);return 0;}两个错误呀,error C2100:illegal indirection

问题描述:

C语言编程 输入圆的半径 r ,计算圆的周长和面积 .其中 π =3.1416
#define PI 3.1416;
#include"stdio.h"
int main()
{
float r,s,c;
scanf("%f",&r);
c=2*PI*r;
s=PI*r*r;
printf("%6.2f,%6.2f\n",s,c);
return 0;
}
两个错误呀,error C2100:illegal indirection

#define PI 3.1416 //后面不需要;
#include "stdio.h"//注意关键字之间要有空格
int main()
{
float r,s,c;
scanf("%f",&r);
c=2*PI*r;
s=PI*r*r;
printf("%6.2f,%6.2f\n",s,c);
return 0;
}