如题所述
#include<stdio.h>
void main()
{ int a,b,c,temp;
printf("Input three number:");
scanf("%d %d %d",&a,&b,&c);
if(b<a)
{ temp=a;a=b;b=temp;
}
if(c<b)
{ temp=b;b=c;c=temp;
}
if(b<a)
{ temp=a;a=b;b=temp;
}
printf("%d %d %d\n",a,b,c);
}
试试看!
void main()
{ int a,b,c,temp;
printf("Input three number:");
scanf("%d %d %d",&a,&b,&c);
if(b<a)
{ temp=a;a=b;b=temp;
}
if(c<b)
{ temp=b;b=c;c=temp;
}
if(b<a)
{ temp=a;a=b;b=temp;
}
printf("%d %d %d\n",a,b,c);
}
试试看!
温馨提示:答案为网友推荐,仅供参考
第1个回答 2020-03-02
#include<stdio.h>
void
main()
{
int
a,b,c,temp;
printf("Input
three
number:");
scanf("%d
%d
%d",&a,&b,&c);
if(b<a)
{
temp=a;a=b;b=temp;
}
if(c<b)
{
temp=b;b=c;c=temp;
}
if(b<a)
{
temp=a;a=b;b=temp;
}
printf("%d
%d
%d\n",a,b,c);
}
试试看!
void
main()
{
int
a,b,c,temp;
printf("Input
three
number:");
scanf("%d
%d
%d",&a,&b,&c);
if(b<a)
{
temp=a;a=b;b=temp;
}
if(c<b)
{
temp=b;b=c;c=temp;
}
if(b<a)
{
temp=a;a=b;b=temp;
}
printf("%d
%d
%d\n",a,b,c);
}
试试看!