老铁们帮忙看看哪里出错了,想他从大到小输出
# include<stdio.h># include<windows.h>
int main()
{
int a,b,c;
int t;
printf("请输入三个数字,用逗号隔开\n");
scanf("%d %d %d",&a,&b,&c);
if(a<b)
{
t=a;
a=b;
b=t;
}
else if(a<c)
{
t=a;
a=c;
c=t;
}
else if(b<c)
{
t=b;
b=c;
c=t;
}
printf("%d %d %d\n",a,b,c);
system("pause");
return 0;
}
# include<stdio.h>
# include<windows.h>
int main()
{
int a,b,c;
int t;
printf("请输入三个数字,用逗号隔开\n");
scanf("%d %d %d",&a,&b,&c);
if(a<b)
{
t=a;
a=b;
b=t;
}
else if(a<c)
{
t=a;
a=c;
c=t;
}
else if(b<c)
{
t=b;
b=c;
c=t;
}
printf("%d %d %d\n",a,b,c);
system("pause");
return 0;
}
# include<stdio.h>
# include<windows.h>
int main()
{
int a,b,c;
int t;
printf("请输入三个数字,用逗号隔开\n");
scanf("%d %d %d",&a,&b,&c);
if(a<b)
{
t=a;
a=b;
b=t;
}
else if(a<c)
{
t=a;
a=c;
c=t;
}
else if(b<c)
{
t=b;
b=c;
c=t;
}
printf("%d %d %d\n",a,b,c);
system("pause");
return 0;
}
# include<stdio.h>
# include<windows.h>
int main()
{
int a,b,c;
int t;
printf("请输入三个数字,用逗号隔开\n");
scanf("%d %d %d",&a,&b,&c);
if(a<b)
{
t=a;
a=b;
b=t;
}
else if(a<c)
{
t=a;
a=c;
c=t;
}
else if(b<c)
{
t=b;
b=c;
c=t;
}
printf("%d %d %d\n",a,b,c);
system("pause");
return 0;
}
输入 1 2 3;
输出 2 1 3