求助!求助!编译不了
本帖最后由 Mmn 于 2020-11-2 17:32 编辑#include <stdio.h>
int max(int a,int b);
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)retun a;else return b;
}
字符串要用引号包裹起来,而且有的地方拼写也有错误。
代码帮你改过来了:
# include <stdio.h>
int max(int a,int b);
int main()
{
int x,y,z;
printf("input two numbersn");
scanf("%d %d", &x, &y);
z=max(x,y);
printf("maxmum=%d",z);
return 0;
}
int max(int a,int b)
{
if(a > b)
return a;
else
return b;
}
页:
[1]