C语言的第二天-比较大小的小程序

#include <stdio.h>
int main()
{
    int a,b,c,max;
    printf("请输入三个数:");
    scanf("%d,%d,%d",&a,&b,&c);
    max = b;
    if (a > b)
    {
        max = a;
    }
    if (c > max)
    {
        max = c;
    }
    printf("最大值是:%d\n",max); //max不在内存地址中,不用加&
    return 0;
}

看看执行结果

posted @ 2017-10-11 22:21  Sch01aR#  阅读(589)  评论(0编辑  收藏  举报