从配置文本里面用fgets读取数据读一行然后寻找出现的字符的次数记下来然后然后累加!直到读完最后一行!
#include #include #include #include using std::map;using std::ifstream;using std::cout;using std::isdigit;int main(){ map count; map else_char; ifstream oo("filename.txt"); char temp; while (!oo.eof()) { oo.get(temp); if(isdigit(temp)) count[temp]++; else else_char[temp]++; } return count.size();}