题解 | #Simple Sorting#

Simple Sorting

https://www.nowcoder.com/practice/139761e0b59a405786898b7f2db9423f

#include <iostream>
#include <map>
#include <vector>
using namespace std;

int main() {
    int a;
    while (cin >> a) { // 注意 while 处理多个 case
        vector<int>k(1001);
        for(int i=0;i<a;i++){
            int m;
            cin>>m;
            k[m]++;
        }
        for(int i=1;i<=1000;i++){
            if(k[i]>0){
                cout<<i<<" ";
            }
        }
        cout<< endl;
    }
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

09-17 19:25
已编辑
太原理工大学 游戏测试
叁六玖:公司名发我,我要这个HR带我打瓦
我的秋招日记
点赞 评论 收藏
分享
10-20 16:50
门头沟学院 Java
牛客68421677...:同是天涯沦落人啊,我也是26届0实习,不知道怎么办了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务