问题标题: 酷町堂:1214

0
0
已解决
黄子澄
黄子澄
中级天翼
中级天翼

20分

#include<iostream>
#include<string>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<iomanip>
using namespace std;
int main(){
    string a;
    cin>>a;
    sort(a.begin(),a.end());
    cout<<a;
    return 0;
}


0
已采纳
李瑞曦
李瑞曦
高级天翼
高级天翼
  • 定义长整型 计数器1号=0,计数器2号=0,b;
  • 输入b
  • while(b大于0)
  • {
    • 数组[计数器1号]=b%10;
    • b=b/10;
    • 计数器1号++;
  • }
  • for(int i=计数器1号-1;i>=1;i--){
    • for(int j=0;j<i;j++)
    • {
      • if(数组[i]<数组[j])
      • swap(数组[i],数组[j]);
    • }
  • }
  • for(int i=0;i<=计数器1号-1;i++)
  • {
    • 计数器2号*=10;
    • 计数器2号+=数组[i];
  • }
  • 输出计数器2号
李瑞曦在2020-06-25 17:39:31追加了内容

用循环取位数做!!!

0
0
0
0
刘英杰
刘英杰
新手天翼
新手天翼

你的错误在于:头文件太多,酷町堂的编译系统识别不了

0
张恩泽
张恩泽
高级天翼
高级天翼

楼上的,这跟头文件有什么关系?

我要回答