要是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];//输出 } } }
使用您的 NWOJ 通用账户