Submission
Status:
[PPPPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: pond4545
Problemset: เรียงสตริง
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-08 20:27:06
#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<c.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;
}