1 solutions

  • 0
    @ 2023-1-21 15:51:43
    #include<bits/stdc++.h>
    using namespace std;
    int a[11]; 
    int main()
    {
    	int n, m;
    	cin >>n;
    	for (int i = 0; i < n; i++){
    		cin >> m;
    		a[m]++;//加入0~9下标数组计算个数 
    	}
    	for(int i = 9; i >= 0; i--){
    		for(int j = 0; j < a[i]; j++){
    			cout << i;//倒序输出,没有则不输出 
    		}
    	} 
    	return 0;
    }
    
    • 1

    Information

    ID
    788
    Time
    1000ms
    Memory
    32MiB
    Difficulty
    10
    Tags
    # Submissions
    4
    Accepted
    4
    Uploaded By