为什么我用C-free5.0运行下面这个程序怎么老出错,哪错了?
#include<stdio.h>#include<math.h>intmain(){constdoublepi=4.0*atan(1.0);doubler,h,s1,s...
#include<stdio.h>
#include<math.h>
int main()
{
const double pi = 4.0 * atan(1.0);
double r, h, s1, s2, s;
scanf("%lf%lf", &r, &h);
s1 = pi*r*r;
s2 = 2*pi*r*h;
s = s1*2.0 + s2;
printf("Area = %.31f\n", s)
return 0;
}
--------------------配置: mingw5 - CUI Debug, 编译器类型: MinGW--------------------
检查文件依赖性...
正在编译 C:\Users\Administrator\Documents\C-Free\Temp\未命名1.cpp...
[Error] C:\Users\Administrator\Documents\C-Free\Temp\未命名1.cpp:12: error: expected `;' before "return"
[Warning] C:\Users\Administrator\Documents\C-Free\Temp\未命名1.cpp:13:2: warning: no newline at end of file
构建中止 未命名1: 1 个错误, 1 个警告 展开
#include<math.h>
int main()
{
const double pi = 4.0 * atan(1.0);
double r, h, s1, s2, s;
scanf("%lf%lf", &r, &h);
s1 = pi*r*r;
s2 = 2*pi*r*h;
s = s1*2.0 + s2;
printf("Area = %.31f\n", s)
return 0;
}
--------------------配置: mingw5 - CUI Debug, 编译器类型: MinGW--------------------
检查文件依赖性...
正在编译 C:\Users\Administrator\Documents\C-Free\Temp\未命名1.cpp...
[Error] C:\Users\Administrator\Documents\C-Free\Temp\未命名1.cpp:12: error: expected `;' before "return"
[Warning] C:\Users\Administrator\Documents\C-Free\Temp\未命名1.cpp:13:2: warning: no newline at end of file
构建中止 未命名1: 1 个错误, 1 个警告 展开
2013-11-29
展开全部
printf("Area = %.31f\n", s)确实;号
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询