#include <stdio.h>
int main(void)
{
int i, ch;
int cnt[10] = {0};
while(1) {
ch = getchar();
if (ch == EOF ) break;
if ( ch >= '0' && ch <= '9‘ )
cnt[ ch - '0‘ ]++;
}
puts("数字文字の出現回数");
for (i = 0; i < 10; i++)
printf("'%d': %d\n", i, cnt[i]);
return (0);
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgIG1haW4odm9pZCkKewogIGludCAgaSwgY2g7CiAgaW50ICBjbnRbMTBdID0gezB9OwoKICB3aGlsZSgxKSB7CiAgICBjaCA9IGdldGNoYXIoKTsKICAgIGlmIChjaCA9PSBFT0YgKSBicmVhazsKCiAgICBpZiAoIGNoID49ICcwJyAmJiBjaCA8PSAnOeKAmCAgKQogICAgICBjbnRbICBjaCAtICcw4oCYICBdKys7CiAgfQoKICBwdXRzKCLmlbDlrZfmloflrZfjga7lh7rnj77lm57mlbAiKTsKICBmb3IgKGkgPSAwOyBpIDwgMTA7IGkrKykKICAgIHByaW50ZigiJyVkJzogJWRcbiIsIGksIGNudFtpXSk7CgogIHJldHVybiAoMCk7Cn0K
prog.cpp:12:29: warning: missing terminating ' character
prog.cpp:12: error: missing terminating ' character
prog.cpp:13:18: warning: missing terminating ' character
prog.cpp:13: error: missing terminating ' character
prog.cpp: In function ‘int main()’:
prog.cpp:14: error: expected primary-expression before ‘}’ token
prog.cpp:14: error: expected `]' before ‘}’ token
prog.cpp:14: error: expected `)' before ‘}’ token
prog.cpp:14: error: expected primary-expression before ‘}’ token
prog.cpp:14: error: expected `;' before ‘}’ token