一个简洁的代码求三个数最大值。
#include<stdio.h>
#define max(x,y)(x>y?x:y)
int main()
{
int a, b, c;
puts("请输入三个数:");
scanf("%d%d%d", &a, &b, &c);
printf("三个数中最大值为:%d\n",max(max(a, b), c));
return 0;
}
一个简洁的代码求三个数最大值。
#include<stdio.h>
#define max(x,y)(x>y?x:y)
int main()
{
int a, b, c;
puts("请输入三个数:");
scanf("%d%d%d", &a, &b, &c);
printf("三个数中最大值为:%d\n",max(max(a, b), c));
return 0;
}