功能1 小文件输入,为表明程序能跑,结果真实而不是迫害老五,请他亲自键盘在控制台下输入命令。
1 #include<stdio.h> 2 #include<string.h> 3 #include<iostream> 4 #include<fstream> 5 #include<string> 6 #include<map> 7 #include <iomanip> 8 using namespace std; 9 int main() 10 { 11 FILE *fp; 12 char text[1024]; 13 char s[100]; 14 //gets(s); 15 printf(">type test.txt "); 16 fp=fopen("d:\test.txt","r"); 17 //fp=fopen(s,"r"); 18 int n=0; 19 int i; 20 map<string,int>my_map; 21 while(fgets(text,1024,fp)!=NULL) 22 { 23 puts(text); 24 i=0; 25 while(text[i]!='