鱼C论坛

 找回密码
 立即注册
查看: 3704|回复: 2

[已解决]新手求助 为什么C语言基础代码打不对

[复制链接]
发表于 2018-1-23 10:19:04 | 显示全部楼层 |阅读模式

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

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

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

void main()
{
        double x,s;
       
        printf("input number:\n")
        scanf("%1f", &x);
        s=sin(x)
        printf("sin of %1f is %1f\n",x,s);
}

我在打
      scanf("%1f", &x);  
         printf("sin of %1f is %1f\n",x,s);   提示编译不了,可是我自己发现不了哪里有打错的地方,请指教。

C:\Users\wb-xy217071\Desktop\main.c        In function 'main':
9        2        C:\Users\wb-xy217071\Desktop\main.c        [Error] expected ';' before 'scanf'
11        2        C:\Users\wb-xy217071\Desktop\main.c        [Error] expected ';' before 'printf'
28                C:\Users\wb-xy217071\Desktop\Makefile.win        recipe for target 'main.o' failed
最佳答案
2018-1-23 10:21:39
2018-01-23_101917.png
微信图片_20180123101456.jpg
微信图片_20180123101137.png
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2018-1-23 10:21:39 | 显示全部楼层    本楼为最佳答案   
2018-01-23_101917.png
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-1-23 10:29:54 | 显示全部楼层

回复的好快,我在你标注的8和10的后面加了一个;就能编译成功了 谢谢
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-14 04:00

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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