POJ 2418 Hardwood Species(字典树)(二)

2015-11-21 01:03:21 · 作者: · 浏览: 18
de #include #include #include using namespace std; int main() { string str; int tot=0; map mp; while(getline(cin,str)){ mp[str]++; tot++; } map ::iterator it; for(it=mp.begin();it!=mp.end();it++){ cout<
first; printf(" %.4f\n",(double)it->second/tot*100); } return 0; }

快排也能过。。