鱼C论坛

 找回密码
 立即注册
查看: 2891|回复: 3

怎么没办法运行

[复制链接]
发表于 2020-2-25 19:16:49 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
#include<stdio.h>
#include<math.h>

void main()
{
        double x, s;

        printf("input number:\n");
        scanf("%lf",&x);
        s = sin(x);
        printf("sin of %lf is %lf\n", x, s);
}
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2020-2-25 19:17:58 | 显示全部楼层
--------------------Configuration: hi - Win32 Debug--------------------
Compiling...
hih.c
C:\Microsoft Visual Studio\MyProjects\hi\hih.c(9) : error C2018: unknown character '0xa3'
C:\Microsoft Visual Studio\MyProjects\hi\hih.c(9) : error C2018: unknown character '0xac'
C:\Microsoft Visual Studio\MyProjects\hi\hih.c(9) : error C2296: '&' : illegal, left operand has type 'char [4]'
C:\Microsoft Visual Studio\MyProjects\hi\hih.c(9) : error C2297: '&' : illegal, right operand has type 'double '
C:\Microsoft Visual Studio\MyProjects\hi\hih.c(9) : error C2198: 'scanf' : too few actual parameters
执行 cl.exe 时出错.

hi.exe - 1 error(s), 0 warning(s)
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-2-25 19:24:26 | 显示全部楼层
仔细检查你的代码,尤其是标点符号
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-2-25 19:31:16 | 显示全部楼层
第 9 行,标点打成中文的了,而且 & 和 x 之间不能有空格。

代码帮你改好了:

  1. #include <stdio.h>
  2. #include <math.h>

  3. void main()
  4. {
  5.     double x, s;

  6.     printf("input number:\n");
  7.     scanf("%lf", &x);
  8.     s = sin(x);
  9.     printf("sin of %lf is %lf\n", x, s);
  10. }
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

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

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-6-27 06:37

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表