Description
请编写程序,输入三个整数,求出其中的最大值输出。
Input
在一行上输入三个整数,整数间用逗号分隔。
Output
输出三个数中的最大值。
Sample
Input
5,7,9
Output
max=9
#include <stdio.h>
int main()
{
int a,b,c,max;
scanf("%d,%d,%d",&a,&b,&c);
if(a > b){
max = a;
}
if(b > a){
max = b;
}
if(max < c){
a = max;
max = c;
}
printf("max=%d",max);
}
未经允许不得转载:作者:Monarchdos,
转载或复制请以 超链接形式 并注明出处 吾爱博客。
原文地址:《求三个整数的最大值》 发布于2020-12-04
评论 抢沙发