运行环境:VS2022
实现形式:
#include
int main()
{
int t, la, lb, lc, i, j, s;
char pa, pb, pc;
scanf_s("%d", &t);
while (t--)
{
scanf_s("%c", &pa,2);
scanf_s("%c", &pb,2);
scanf_s("%c", &pc,2);
la = pa; lb = pb; lc = pc;
int d[3] = { la,lb,lc };
for(i=0;i<3;i++)
for (j = 0; j < 3; j++)
{
if (d[j] > d[j + 1])
{
s = d[j];
d[j] = d[j + 1];
d[j + 1] = s;
}
}
for (i = 0; i < 3; i++)
printf("%c ", d[i]);
}
return 0;
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)