/* Count syllable in KS C 5601-1987 */ #include unsigned long count[25][94] = {0}; void main() { int i, j, c1, c2; long nsyl=0, n_occ=0; c1 = getchar(); while (c1 != EOF) { if(c1 & 0x80) { c2 = getchar(); count[c1-0xB0][c2-0xA1]++; n_occ++; } c1 = getchar(); } for (i=0; i < 25; i++) { for (j=0; j < 94; j++) { if (count[i][j]) { printf("%c%c %10ld %10.4f\n", i+0xB0, j+0xA1, count[i][j], (float)count[i][j]/(float)n_occ*100.0); nsyl++; } } } printf("À½Àý °³¼ö = %ld, ÃÑ À½Àý¼ö = %ld\n", nsyl, n_occ); }