top1编程
← 返回题目
题解

【入门】粉碎数字

1 条题解

  • 0
    @ 2026-7-28 23:24:09
    #include <bits/stdc++.h>
    using namespace std;
    bool cmp(int a,int b){
    	if(a>b){
    		return true;
    	}else{
    		return false;
    	}
    }
    int main() {
    	int n;
    	string s="",c="";
    	cin>>n;
    	for(int i=0;i<n;i++){
    		cin>>s;
    		c+=s;
    	}
    	sort(c.begin(),c.end(),cmp);
    	cout<<c;
    }
    
    • 1