谁会这个?
、【数论及其他】一篇英文文章存放在数组Str[25][80]中,请统计单词word出现的次数(待统计的单词由键盘输入,需按区分大小写及不区分大小写两种情况讨论。
会的朋友帮个忙~~~
// ... int i = 0, j = 0; int word_cnt = 0; char word[4][2] = {{119, 87},{111, 79}, {114, 82}, {100, 68}}; for (i = 0; i < 25; i++) { if ((Str[i][0] == word[0][0] || Str[i][0] == word[0][1]) && (Str[i][1] == word[1][0] || Str[i][1] == word[1][1]) && (Str[i][2] == word[2][0] || Str[i][2] == word[2][1]) && (Str[i][3] == word[3][0] || Str[i][3] == word[3][1]) && (Str[i][4] == '\0') ) word_cnt++; } // ...