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