编写一个C程序,输入 ABC3个值,输出其中最大者

来源:百度知道 编辑:UC知道 时间:2024/05/16 12:37:12

#include <stdio.h>

void main()
{
int a[4]={3,4,1,6]
int t=a[0],temp;

for(i=1;i<4;i++)
if(t<a[i]) t=a[i];

printf("The max NUM: %d\n",t);
}

#include <stdio.h>

main()
{int a,b,c,temp;
printf("input the number of a&b&c:");
scanf("%d%d%d",&a,&b,&c);
if(a>b)temp=a;
else temp=b;
if(temp<c)temp=c;
printf("the max is %d",temp);
}