|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#include<math.h>
#include<stdio.h>
main()
{
double x,s;
printf("input number:\n");
scanf("%lf,&x);
s = sin(x);
printf("sine of %lf is %if\n",x,s);
}
请问我这个有什么错误吗?
为什么一直给我报这个
D:\1\1.c(8) : error C2146: syntax error : missing ')' before identifier 's'
本帖最后由 liuzhengyuan 于 2020-6-30 16:53 编辑
第 6 行、分号(;)变成了中文标点
第 8 行、scanf 缺少右引号 → scanf("%lf ",&x);
第 11 行、大括号(})变成了中文标点
直接帮你改好了:
- #include<math.h>
- #include<stdio.h>
- main()
- {
- double x, s;
- printf("input number:\n");
- scanf("%lf", &x);
- s = sin(x);
- printf("sine of %lf is %if\n", x, s);
- }
复制代码
|
|