开汗蒸房的好处:C程序问题,望各位高手来回答啊

来源:百度文库 编辑:高考问答 时间:2024/05/03 05:47:08
用C语言编写一个程序:输入A,B,C三个值,输出其中的最大者,这段程序该如何编写啊,各位老大帮帮忙吧,谢了啊

#include<stdio.h>
void main()
{int A,B,C,t;
scanf(\"%d%d%d\",&A,&B,&C);
printf(\"the max is %d\",t=(a>b?a:b)>c?t:c);
}

#include <stdio.h>
main()
{
int a,b,c;
printf("输入三个数\n");
printf("a=");
scanf("%d",&a);

printf("b=");
scanf("%d",&b);

printf("C=");
scanf("%d",&c);

if(a>b)
b=a;

if(b>c)
c=b;
printf("最大数是%d",c);
}