C语言编程:有三个整数abc,由键盘输入,输出其中最大的数

如题所述

#include <stdio.h>
void main()
{
int a,b,c,max;
scanf("%d %d %d",a,b,c);
max=a;
if(max<b)
max=b;
if(max<c)
max=c;
printf("最大值:%d",max);
}
输入以空格分开。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2020-11-06

本次课程我们主要讲解使用C语言如何实现求若干个数的最大数和最小数,首先我们讲解一下设计思路和伪代码,之后为大家详细展示源码,最后为大家分享一些这类程序的设计思路,欢迎大家加入程序员小白学开发一起学习!

第2个回答  2008-11-18
#include<stdio.h>
void main()
{
int a,b,c,out;
scanf("%d%d%d",&a,&b,&c);
out=a;
if(b>out) out=b;
if(c>out) out=c;
printf("%d\n",out);
}
简单的写了下……
第3个回答  2008-11-18
<#include stdio.h>
<#include math.h>
void main()
{int temp;
scanf("%d",&a[i]);
temp = max(a[i]);
printf("the max number you put is %d/n",temp);
}
void max()
{
int a;
int b;
int c;
if(a > b){
c = a;}
else {
c = b;}
end if;
}本回答被网友采纳
第4个回答  2017-06-05
#include "stdio.h"
void main()
{
int a,b,c,max;
printf("a,b,c:");
scanf("%d %d %d",&a,&b,&c);
max=a;
if(max<b) max=b;
if(max<c) max=c;
//printf("a:%d,b:%d,c:%d\n",a,b,c);
printf("%d\n",max);
}
相似回答