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 ===|
展开
 我来答
匿名用户
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这两个函数。。
匿名用户
推荐于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);
} 英文状态的双引号(黑体部分)被你写成中文双引号了
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式