heichuan233 @ 2024-07-24 22:57:49
#include<stdio.h>
int main()
{
int a[3], i, j,t;
char s[3],x;
for (i = 0; i < 3; i++)
scanf("%d", &a[i]);
x=getchar();
scanf("%c%c%c", &s[0], &s[1], &s[2]);
for(i=0; i<2; i++)
for (j = 0; j <2 - i; j++)
{
if (a[j] > a[j+1])
{
t = a[j];
a[j] = a[j+1];
a[j+1] = t;
}
}
for (i = 0; i < 3; i++)
{
printf("%d ", a[s[i] - 'A']);
}
}
by koishi0514 @ 2024-10-09 21:49:48
第八行下面再加一个getchar()试试,这样就应该对了,但是调试的时候输出会少一个数字,我也不理解