22智能在线
新记
写个c语言程序 运行时输入a,b,c三个值时,输出其中最大者
如题所述
举报该文章
相关建议 2019-02-27
参考代码
#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;
}
温馨提示:内容为网友见解,仅供参考
当前网址:
https://22.t2y.org/zz/fh2s6f2c06xcicsifx6.html
其他看法
无其他回答
相似回答
大家正在搜
相关问题
c语言 编写一个程序,输入a、b、c三个值,输出最大值
编写c语言程序,运行时输入a,b,c三个值时,输出其中最大者...
编写一个C程序,输入a,b,c 三个值,输出其中最大者
c语言程序设计,试编写一个程序,输入a,b,c三个值,输出其...
编写一个C程序,运行时输入a,b,c三个值,输出其中值最大者
编写C语言程序,输入a b c 3个值,输出其中最大值
编写一个C程序,输入abc三个值,输出其中最大者