C语言实验——求三个整数的最大值
Time Limit: 1000MS
Memory Limit: 65536KB
Problem Description
请编写程序,输入三个整数,求出其中的最大值输出。
Input
在一行上输入三个整数,整数间用逗号分隔。
Output
输出三个数中的最大值。
Example Input
5,7,9
Example Output
max=9
Hint
Author
wy
参考代码
#include <stdio.h>
void main()
{
int a,b,c,max;
scanf("%d,%d,%d",&a,&b,&c);
if(a > b)
max = a;
else
max = b;
if(c > max)
printf("max=%d",c);
else
printf("max=%d",max);
}