Submission

Status:

[PPPP-SSSSS]

Subtask/Task Score:

{0/100}

Score: 0

User: pond4545

Problemset: เรียงสตริง

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-08 20:19:03

#include<iostream>
#include<string>
using namespace std;

int main()
{
    string s,c;
    cin >> s;
    for(int i=0;i<s.length();i++)
    {
        bool a=false;
        for(int j=0;j<s.length();j++)
        {
            if(c[j]==s[i])
            {
                a=true;
            }
        }
        if(!a)
        {
            c+=s[i];
        }
    }
    for(int i=0;i<c.length();i++)
    {
        for(int j=0;j<c.length();j++)
        {
            if(c[i]<c[j])
            {
                int x;
                x=c[i];
                c[i]=c[j];
                c[j]=x;
            }
        }
    }
    for(int i=0;i<c.length();i++)
    {
        cout << c[i] << " ";
    }
    return 0;
}