c++编程问题
#include"math.h"#include"stdio.h“main(){floata,b,c,p,s;printf("pleaseinputthedate!\n"...
#include "math.h"
#include "stdio.h“
main()
{
float a,b,c,p,s;
printf("please input the date!\n");
scanf("%f,%f,%f",&a,&b,&c);
p=(a+b+c)/2;
s=sqrt(p*(p-a)*(p-b)*(p-c));
printf("s=%f\n",s);
}
求三角形面积为啥现实有错?\Untitled1.c|2|#include expects "FILENAME" or <FILENAME>|
\Untitled1.c||In function `int main()':|
\Untitled1.c|6|error: `printf' was not declared in this scope|
\Untitled1.c|7|error: `scanf' was not declared in this scope|
||=== Build finished: 3 errors, 0 warnings ===| 展开
#include "stdio.h“
main()
{
float a,b,c,p,s;
printf("please input the date!\n");
scanf("%f,%f,%f",&a,&b,&c);
p=(a+b+c)/2;
s=sqrt(p*(p-a)*(p-b)*(p-c));
printf("s=%f\n",s);
}
求三角形面积为啥现实有错?\Untitled1.c|2|#include expects "FILENAME" or <FILENAME>|
\Untitled1.c||In function `int main()':|
\Untitled1.c|6|error: `printf' was not declared in this scope|
\Untitled1.c|7|error: `scanf' was not declared in this scope|
||=== Build finished: 3 errors, 0 warnings ===| 展开
2个回答
2014-01-03
展开全部
\Untitled1.c|2|#include expects "FILENAME" or <FILENAME>|:第二行#include "stdio.h“,后面那个引号要英文引号。。\Untitled1.c||In function `int main()':|:main()函数默认返回值类型为int,而你没有返回int类型数据,要么程序最后加个return 1;要么把main()改为void main(),即返回值类型为空。。\Untitled1.c|6|error: `printf' was not declared in this scope|
\Untitled1.c|7|error: `scanf' was not declared in this scope|:因为前面"stdio.h"出错,等于没有加进这个头文件,就找不到printf和scanf这两个函数。。
\Untitled1.c|7|error: `scanf' was not declared in this scope|:因为前面"stdio.h"出错,等于没有加进这个头文件,就找不到printf和scanf这两个函数。。
推荐于2018-04-20
展开全部
#include "math.h"
#include "stdio.h"main()
{
float a,b,c,p,s;
printf("please input the date!\n");
scanf("%f,%f,%f",&a,&b,&c);
p=(a+b+c)/2;
s=sqrt(p*(p-a)*(p-b)*(p-c));
printf("s=%f\n",s);
} 英文状态的双引号(黑体部分)被你写成中文双引号了
#include "stdio.h"main()
{
float a,b,c,p,s;
printf("please input the date!\n");
scanf("%f,%f,%f",&a,&b,&c);
p=(a+b+c)/2;
s=sqrt(p*(p-a)*(p-b)*(p-c));
printf("s=%f\n",s);
} 英文状态的双引号(黑体部分)被你写成中文双引号了
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询