zoukankan      html  css  js  c++  java
  • 10420 List of Conquests

    C++语言: Codee#25825
    01 /*
    02 +++++++++++++++++++++++++++++++++++++++
    03                 author: chm
    04 +++++++++++++++++++++++++++++++++++++++
    05 */
    06
    07 #include <map>
    08 #include <set>
    09 #include <list>
    10 #include <queue>
    11 #include <cmath>
    12 #include <stack>
    13 #include <bitset>
    14 #include <cstdio>
    15 #include <cctype>
    16 #include <string>
    17 #include <vector>
    18 #include <cassert>
    19 #include <cstdlib>
    20 #include <cstring>
    21 #include <fstream>
    22 #include <sstream>
    23 #include <iomanip>
    24 #include <iostream>
    25 #include <algorithm>
    26
    27 using namespace std;
    28
    29 FILE*            fin         = stdin;
    30 FILE*            fout         = stdout;
    31 const int        max_size     = 10086;
    32 char line[max_size];
    33 map<string, int> country;
    34 int main()
    35 {
    36
    37     int n;
    38     char tmp[99];
    39     char ch;
    40     cin>>n;
    41     cin.get();
    42     while(n--)
    43     {
    44         cin.getline(line, sizeof(line));
    45         sscanf(line, "%s", tmp);
    46         string str(tmp);
    47         ++country[str];
    48     }
    49     for(map<string, int>::iterator it = country.begin(), itend = country.end();
    50             it != itend; ++it)
    51         cout << it->first << " " << it->second << endl;
    52     return 0;
    53 }
  • 相关阅读:
    商人的诀窍
    商人小鑫
    懒虫小鑫
    悼念512汶川大地震遇难同胞
    最少拦截系统
    活动选择问题
    删数问题
    常用排序算法的时间和空间复杂度总结
    一些博主
    C中自己的memcpy
  • 原文地址:https://www.cnblogs.com/invisible/p/2397512.html
Copyright © 2011-2022 走看看