用c语言编写,计算3个整数之间的最大值
#include<stdio.h>
void main()
{
int a,b,c,temp;
scanf("%d,%d,%d,",&a,&b,&c);
if(a<b)
{
temp=a;
a=b;
b=temp;
}
if(a<c)
{
temp=a;
a=c;
c=temp;
}
if(b<c)
{
temp=b;
b=c;
c=temp;
}
printf("%d>%d>%d\n",a,b,c);
}
void main()
{
int a,b,c,temp;
scanf("%d,%d,%d,",&a,&b,&c);
if(a<b)
{
temp=a;
a=b;
b=temp;
}
if(a<c)
{
temp=a;
a=c;
c=temp;
}
if(b<c)
{
temp=b;
b=c;
c=temp;
}
printf("%d>%d>%d\n",a,b,c);
}
温馨提示:答案为网友推荐,仅供参考