1 条题解

  • 4
    @ 2026-8-18 14:45:06

    要是25去考了这不三等

    这题主要考排序,其次就是考字符串的运用

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	char s[1145140];cin>>s;//用字符串形式读入
    	int a=strlen(s);//获取字符串数组长度
    	sort(s, s+a);//排序字符串
    	for(int i=a;i>=0;i--){
    		if(s[i]>='0'&&s[i]<='9'){//判断是否是数字
    			cout<<s[i];//输出
    		}
    	}
    } 
    
    • 1

    信息

    ID
    393
    时间
    1000ms
    内存
    256MiB
    难度
    9
    标签
    (无)
    递交数
    53
    已通过
    6
    上传者