记录编号 |
160311 |
评测结果 |
AAAAAAAAAAAAAAAAAAAA |
题目名称 |
KZ菌的家庭作业 |
最终得分 |
100 |
用户昵称 |
wolf. |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.014 s |
提交时间 |
2015-04-24 22:49:17 |
内存使用 |
0.32 MiB |
显示代码纯文本
- #include<iostream>
- #include<fstream>
- #include<bitset>
- #include<vector>
- #include<deque>
- #include<map>
- #include<set>
- #include<queue>
- #include<string>
- #include<algorithm>
- #include<cmath>
- #include<ctime>
- #include<cstdio>
- using namespace std;
- #if defined wolf
- const string ok="OK";
- const string kk=" ";
- ofstream nnew("KZhomeworkillu.in",ios::app);
- ifstream fin("KZhomeworkillu.in");
- #define fout cout
- #define Endl endl
- #else
- ifstream fin("KZhomeworkillu.in");
- ofstream fout("KZhomeworkillu.out");
- #endif
- int main(){
- string txt;
- map<char,int> TT;
- for(int i=0;i!=26;++i){
- TT[(char)(i+'A')]=0;
- }
- for(int i=0;i!=26;++i){
- TT[(char)(i+'a')]=0;
- }
- while(fin>>txt){
- //cout<<txt<<endl;
- for(int i=0;i!=txt.size();++i){
- if((txt[i]>='a'&&txt[i]<='z')||(txt[i]>='A'&&txt[i]<='Z')){
- TT[txt[i]]++;
- }
- }
- }
- map<char,int>::iterator it;
- it=TT.begin();
- while(it!=TT.end()){
- if((it->second)!=0){
- fout<<(it->first)<<":"<<(it->second)<<endl;
- }
- ++it;
- }
- //-------------------------*/
- #if defined wolf
- cout<<endl<<(double)clock()/CLOCKS_PER_SEC<<'s'<<endl;
- #endif
- return 0;
- }
- //Designed by wolf
- //Fri Apr 24 2015