c++ 中提示 syntax error : '=' 求教
#include<stdio.h>#include<math.h>#definePI=3.1415926intmain(void){floatarea;floatr,l;...
# include <stdio.h>
# include <math.h>
# define PI = 3.1415926
int main(void)
{
float area;
float r,l;
area = PI*r*r;
l = 2*r,r = l / 2;
printf("输入圆的半径\n",r,l);
scanf("d%,%d\n",&r,&l);
printf("该圆的面积area,area = %f\n",area);
return 0;
} 展开
# include <math.h>
# define PI = 3.1415926
int main(void)
{
float area;
float r,l;
area = PI*r*r;
l = 2*r,r = l / 2;
printf("输入圆的半径\n",r,l);
scanf("d%,%d\n",&r,&l);
printf("该圆的面积area,area = %f\n",area);
return 0;
} 展开
3个回答
展开全部
应该改成这样(您的程序不止=这一个错误):
# include <stdio.h>
# include <math.h>
# define PI 3.1415926
int main(void)
{
float area;
float r;
printf("输入圆的半径\n");
scanf("%f",&r);
area = PI*r*r;
printf("该圆的面积area,area = %f\n",area);
return 0;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询