鱼C论坛

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

[已解决]求大佬帮忙看看

[复制链接]
发表于 2019-12-9 15:22:49 | 显示全部楼层 |阅读模式

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

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

x
我在Dev-c++5.11上面打小甲鱼教学c语言的视频第一集最后面留的那个例1.3的时候编辑器一直报警
int max(int a,int b);
int main()
{
        int x,y,z;
        int max(int a,int b);
        printf("input two numbers:\n");就是这一行
        scanf("%d%d",&x,&y);
        z=max(x,y);
        printf("maxmum=%d",z);
}

int max(int a,int b)
{
        if(a>b)return a;else return b;
}
                C:\Users\Administrator\Desktop\小甲鱼.c\例1.3.cpp        In function 'int main()':
6        31        C:\Users\Administrator\Desktop\小甲鱼.c\例1.3.cpp        [Error] 'printf' was not declared in this scope
7        20        C:\Users\Administrator\Desktop\小甲鱼.c\例1.3.cpp        [Error] 'scanf' was not declared in this scope
就一直给我这样的警报,是为什么啊?
最佳答案
2019-12-9 15:51:37
你是不是没打#include<stdio.h>
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2019-12-9 15:51:37 | 显示全部楼层    本楼为最佳答案   
你是不是没打#include<stdio.h>
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2019-12-9 15:59:38 | 显示全部楼层
  1. #include <stdio.h>

  2. int max(int a,int b)
  3. {
  4.         if(a>b) return a;else return b;
  5. }
  6. int main()
  7. {
  8.         int x,y,z;
  9.         printf("input two numbers:\n");//就是这一行
  10.         scanf("%d%d",&x,&y);
  11.         z=max(x,y);
  12.        
  13.         printf("max num = %d\n",z);
  14.        
  15.         return 0;
  16. }
复制代码
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2019-12-9 18:32:00 | 显示全部楼层

真的是!谢谢老哥
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-3-28 20:38

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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