解题思路:
注意事项:
参考代码:
#include <bits/stdc++.h>
using namespace std;
long long tong[100000];
int main()
{
int n;
cin>>n;
for(int i=1; i<=n; i++)
{
int a;
cin>>a;
tong[a]++;//放到对应的桶中
}
for(int i=0; i<100000; i++)
{
while(tong[i]--)//输出重复的数//也可以用for(int j=0;j<100000;j++);
{
cout<<i<<' ';
}
}
return 0;
}
0.0分
0 人评分
小九九 (C语言代码)浏览:817 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:587 |
字符逆序 (C语言代码)浏览:636 |
IP判断 (C语言描述,蓝桥杯)浏览:1094 |
打印十字图 (C语言代码)浏览:2701 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:519 |
C语言程序设计教程(第三版)课后习题9.3 (C语言代码)浏览:593 |
The 3n + 1 problem (C语言代码)浏览:501 |
妹子杀手的故事 (C语言代码)浏览:1046 |
复数求和 (C语言代码)浏览:916 |