首页 > 电脑

c语言比较大小代码

更新时间2021-10-03 18:10:32

#include <stdio.h>
 
int max (int,x int,y)
{
int z;
if (x>y)z=x;
else z=y;
return(z);
}
void main()
{
int  a, b, c;
printf("input two numbers: ");
scanf("%d%d", &a, &b);
c=max(a,b);
printf("max=%d ", c);
}
为什么我的这个不行

你的

int max (int,x int,y)

正确的为

int max (int x ,int y) //逗号位置错了

以下是测试结果:

c语言比较大小代码

相关标签:c语言

上一篇:一个“C”加一个“-”这个横穿在C中间,这个符号怎么打出来啊?

下一篇:学的c,字符‘0’的ascii码16进制为0x30