- [必做 2] 读取小文本文件A_Tale_of_Two_Cities.txt 或者 大文本文件Gone_with_the_wind.txt,统计某一指定单词在该文本文件中出现的频率。
结对对象:叶月欣 1413042001 博客地址: http://www.cnblogs.com/yeyuexin/
Github链接:https://github.com/yangyangji/ex.2
双方贡献比例: 1:1
结对编程照片:
源程序
#include<iostream> #include<fstream> #include<cstring> #include<string> using namespace std; struct Word{ //定义结构体 int Count;//计数器 Word() : Str(""), Count(0) {} string Str; //字符串 char *p; }; void exchange(Word &word) //函数,用于交换单词(排序单词) { string tStr = word.Str; int tCount = word.Count; word.Str = Str; word.Count = Count; Str = tStr; Count = tCount; } Words test[100]; void lwr(char x[]) //大写转小写 { int k = 0; while (x[k] != '