鱼C论坛

 找回密码
 立即注册
查看: 2563|回复: 6

c语言

[复制链接]
发表于 2021-3-13 00:32:49 From FishC Mobile | 显示全部楼层 |阅读模式

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

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

x
我按屏幕打后总出现这个是啥意思呀,麻烦各路大佬帮忙解答一下,万分感谢!
test2.c:3:1: warning: return type defaults to 'int'[ -Wimplicit- int ]

main( )

A~~ ~

test2.c: In function ' main' :

test2.c:6:5:error: expected

asm

attribute ' before 'pr intf'

pr intf("input number :/n" ):

A~~ ~~ ~

test2.c:5:12: warning: unused variable 'x' [-Wunused-variable]

double x,s
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2021-3-13 00:42:58 | 显示全部楼层
        你要把代码文本贴出来,别人又不是神仙,谁知道你究竟写了些什么。
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2021-3-13 02:52:24 | 显示全部楼层
函数名: pr intf ?
另外用了asm?c和汇编的混合编程?没源码谁知道
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2021-3-13 14:24:33 From FishC Mobile | 显示全部楼层
jackz007 发表于 2021-3-13 00:42
你要把代码文本贴出来,别人又不是神仙,谁知道你究竟写了些什么。

#include<math.h>
#include<stdio.h>
void main()
{
    double x,s;
    printf("input number\n");
    scanf("%1f",&x);
    s=sin(x);
    printf("sine of %1f is %1f\n",x,s);
}
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2021-3-13 14:25:16 From FishC Mobile | 显示全部楼层
yerah 发表于 2021-3-13 14:24
#include
#include
void main()

这个
麻烦了谢谢!
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2021-3-13 14:31:17 | 显示全部楼层
yerah 发表于 2021-3-13 14:24
#include
#include
void main()

sin呢,应该丢了一个sin函数调用吧
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2021-3-13 15:34:54 | 显示全部楼层
  1. #include <stdio.h>
  2. #include <math.h>

  3. #define PI 3.14159265358979323846264338327950288f

  4. int main(void)
  5. {
  6.         int x                                                ;
  7.         printf("input number : ")                            ;
  8.         scanf("%d" , & x)                                    ;
  9.         printf("sin(%d) = %lf\n" , x , sin(x * PI / 180.0f)) ;
  10. }
复制代码

        编译、运行实况:
  1. D:\00.Excise\C>g++ -o x x.c

  2. D:\00.Excise\C>x
  3. input number : 30
  4. sin(30) = 0.500000

  5. D:\00.Excise\C>x
  6. input number : 60
  7. sin(60) = 0.866025

  8. D:\00.Excise\C>
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-4-30 21:40

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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