帮看下C语言哪错了

[复制链接]
查看11 | 回复3 | 2013-2-14 21:21:00 | 显示全部楼层 |阅读模式
#include#includevoid main()
//void 表示没有返回值{ double x,s;
//符号用半角的 printf("input number\n");
//反斜杠 scanf("%lf",&x);
//中间少个逗号 s=sin(x);
//sin函数写错了 printf("sine of%lfis%lf\n",x,s);//少写了一个参数} 注意sin函数是弧度制的,x/180*3.14可换为角度制...
回复

使用道具 举报

千问 | 2013-2-14 21:21:00 | 显示全部楼层
#include#includevoid main(){double x,s;printf("input number\n");scanf("%lf",&x);s=sin(x);printf("sin(%lf) is %lf\n",x,s);}可以运行了。但题目没注意角度和弧度的转换。...
回复

使用道具 举报

千问 | 2013-2-14 21:21:00 | 显示全部楼层
scanf()函数里面少了个逗号。...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行