zoukankan      html  css  js  c++  java
  • uva-10420-排序

    根据国家名字统计人数,然后排序

    #include<stdio.h>
    #include<iostream>
    #include<queue>
    #include<map>
    #include<memory.h>
    #include <math.h>
    #include<time.h>
    #include <stdlib.h>
    using namespace std;
    
    struct Node
    {
        string key;
        int total;
    };
    int main()
    {
        freopen("d:\1.txt","r",stdin);
        int n;
        cin>>n;
        map<string,int>maps;
        string str;
        for(int i = 0; i< n;i++)
        {
            cin>>str;
            int j  = maps[str];
            j++;
            maps[str] = j;
            getline(cin,str);
        }
        map<string,int>::iterator iter;
        for(iter = maps.begin(); iter != maps.end(); ++iter)
        {
            cout<<iter->first<<" "<<iter->second<<endl;
        }
    
        return 0;
    }
  • 相关阅读:
    堆排序算法
    基数排序
    快速排序
    OpenSSL加密证书
    jobs后台任务
    at,crontab例行性任务
    dns
    ftp
    ssh
    iptables
  • 原文地址:https://www.cnblogs.com/shuiyonglewodezzzzz/p/7191111.html
Copyright © 2011-2022 走看看