跳到正文

个人记录

个人记录+

Wgx54188约 1 分钟
原文
文章信息与版本

文章信息

发布
2025年10月12日
收录
2025年12月12日
更新
2026年11月16日
篇幅
约 1 分钟

版本

  1. v1当前
C++
#include<bits/stdc++.h>
using namespace std;
int a[10005],x,y,s;
int main(){
    cin>>x;
    for(int i=1;i<=x;i++){
        cin>>y;
        a[y]+=1;
    }
    for(int i=0;s<x-1;i++){
        if(a[i]>0){
            cout<<i<<' '<<a[i]<<endl;
            s++;
        }
    }
}
原文