1 /* 2 输入文件见337.in.txt 3 输出文件见338.out.txt 4 */ 5 #include <iostream> 6 #include <cctype> 7 #include <fstream> 8 #include <cstring> 9 using namespace std; 10 11 const int maxList = 2048 * 10 + 10; //单词表的最大值 12 const int maxWord = 100 + 10; //单词长度的最大值 13 14 struct WordList 15 { 16 char word[maxWord]; //单词 17 int fre; //词频 18 } list[maxList]; 19 20 char *Delete(char *str,char c) //删除一个单词中的标点符号. 如: declicious! 删去! 21 { 22 char *p = str; //声明一个指针指向自己 23 char *p2 = str; //如果str自己移动指针的话,最后返回str时,返回的是尾指针,输出为空 24 while (*p2) 25 { 26 if (*p2 == c) 27 p2++; 28 else 29 *p++ = *p2++; 30 } 31 *p = '