Submission
Status:
[PPPPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: erng
Problemset: เรียงสตริง
Language: cpp
Time: 0.003 second
Submitted On: 2025-10-05 22:43:40
#include <bits/stdc++.h>
using namespace std;
int t, k;
string st;
int main()
{
cin>>st;
for (int i=0; i<st.size(); i++)
{
for (int j=0; j<st.size()-i-1; j++)
{
if (st[j]>st[j+1])
{
t=st[j];
st[j]=st[j+1];
st[j+1]=t;
}
}
}
for (int i=0; i<st.size(); i++)
{
for (int j=i+1; j<st.size(); j++)
{
if (st[i]==st[j])
{
st[j]='*';
}
}
}
for (int i=0; i<st.size(); i++)
{
if (st[i]=='*') continue;
cout<<st[i]<<" ";
}
}