#include <stdio.h>
#define CHARNUMBER 3 // 输入字符数
int main(void)
{
char charArray[CHARNUMBER];
int i, j;
for (i = 0; i < CHARNUMBER; i++)
{
charArray[i] = getchar();
}
for (i = 0; i < CHARNUMBER; i++)
{
for (j = i + 1; j < CHARNUMBER; j++)
{
if (charArray[i] > charArray[j])
{
char temp = charArray[j];
charArray[j] = charArray[i];
charArray[i] = temp;
}
}
}
for (i = 0; i < CHARNUMBER; i++)
{
putchar(charArray[i]);
}
return 0;
} |