dehyadego @ 2024-11-10 21:01:13
#include<stdio.h>
int main()
{
int a,b,c,A,B,C,x,y,z;
scanf("%d %d %d\n",&a,&b,&c);
scanf("%1c %1c %1c",&x,&y,&z);
if(a>b)
{
if(b>c)
{
C=a;
B=b;
A=c;
}
else
{
if(a>c)
{
C=a;
B=c;
A=b;
}
else
{
C=c;
B=a;
A=b;
}
}
}
else
{
if(a>c)
{
C=b;
B=a;
A=c;
}
else
{
if(b>c)
{
C=b;
B=c;
A=a;
}
else
{
C=c;
B=b;
A=a;
}
}
}
if(x>y)
{
if(y>z)
{
printf("%d %d %d",C,B,A);
}
else
{
if(x>z)
{
printf("%d %d %d",C,A,B);
}
else
{
printf("%d %d %d",B,A,C);
}
}
}
else
{
if(x>z)
{
printf("%d %d %d",B,C,A);
}
else
{
if(y>z)
{
printf("%d %d %d",A,C,B);
}
else
{
printf("%d %d %d",A,B,C);
}
}
}
return 0;
}
by Star0925 @ 2024-11-10 21:28:23
其实不需要这么多判断语句,查错会很麻烦
by Star0925 @ 2024-11-10 21:31:38
找ABC就从小到大一个一个找,输出可以这样```cpp if(x=='A'&& y=='B' && z=='C') do something...
这样就只用3个判断