题解 | #图片整理#
图片整理
http://www.nowcoder.com/practice/2de4127fda5e46858aa85d254af43941
int main(void)
{
char str[1001][1] = {'\0'};
int hash[1001] = {0};
char ch;
int i = 0;
while ((ch = getchar()) != '\n')
{
int tmp = ch;
if (str[tmp][1] != '\0')
hash[tmp]++;
else
{
str[tmp][1] = ch;
hash[tmp] = 1;
}
}
for (int j = 0; j < 1001; ++j)
{
while (hash[j] > 0)
{
printf("%c", str[j][1]);
hash[j]--;
}
}
return 0;
}