求三个整数的最大值

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);
}
温馨提示: 本文最后更新于2020-12-04,至今已有1239天,某些文章具有时效性,若有错误或已失效,请在下方留言
© 版权声明
THE END
喜欢就支持一下吧❀
点赞0投币 分享
评论 抢沙发

    请登录后查看评论内容