C/C++の宿題を片付けます 91代目
■ このスレッドは過去ログ倉庫に格納されています
0501デフォルトの名無しさん
2007/06/29(金) 06:03:57#include <stdio.h>
int main(void)
{
int c, nc[256] = {0}, nmax = 0, n, found;
while ((c = getchar()) != EOF) {
nc[c]++;
if (nc[c] > nmax)
nmax = nc[c];
}
for (n = 1; n <= nmax; n++) {
found = 0;
for (c = 0; c < 256; c++) {
if (nc[c] == n) {
putchar(c);
found = 1;
}
}
if (found)
printf("→%d", n);
}
printf("\n");
return 0;
}
■ このスレッドは過去ログ倉庫に格納されています