写个c语言程序 运行时输入a,b,c三个值时,输出其中最大者

如题所述

参考代码
#include <stdio.h>

int main(void) { 

int a,b,c;

scanf("%d %d %d",&a,&b,&c);// 输入3个数

int max = a;//默认最大值为a

//选出a,b中的最大值

if(max<b)

max = b;

//将前两个中最大值与c比较,得出真正的最大值

if(max < c)

max = c;

printf("%d",max);//输出最大值

return 0;

}
温馨提示:答案为网友推荐,仅供参考
相似回答