难得一见的水题,就是输入n个1~100的正整数,让你输出排序完的数字. 直接存进一个 c n t cnt cnt数组里面算就是了.
/*
*/
#include
using namespace std;
typedef long long ll;
const int maxn = 3e5+2;
const int INF = 1e9+7;
typedef pair pii;
int main(){
// freopen("1.txt","r",stdin);
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
while(cin>>n&&n){
vector cnt(101,0);
for(int x,i=0;i>x;
cnt[x]++;
}
bool first = true;
for(int i=1;i
关注
打赏