求大佬帮忙看看
我在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 'printf' was not declared in this scope
7 20 C:\Users\Administrator\Desktop\小甲鱼.c\例1.3.cpp 'scanf' was not declared in this scope
就一直给我这样的警报,是为什么啊? 你是不是没打#include<stdio.h>
#include <stdio.h>
int max(int a,int b)
{
if(a>b) return a;else return b;
}
int main()
{
int x,y,z;
printf("input two numbers:\n");//就是这一行
scanf("%d%d",&x,&y);
z=max(x,y);
printf("max num = %d\n",z);
return 0;
} 最后的魁拔 发表于 2019-12-9 15:51
你是不是没打#include
真的是!谢谢老哥
页:
[1]