Submission
Status:
[PPPPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: Max
Problemset: เรียงสตริง
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-13 17:57:08
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
string upper = "";
string lower = "";
string word;
string result = "";
cin >> word;
for (char c : word)
{
if (result.find(c) == string::npos)
result += c;
}
for (char c : result)
{
if (isupper(c))
upper += c;
else
lower += c;
}
sort(upper.begin(), upper.end());
sort(lower.begin(), lower.end());
for (char c : upper)
{
cout << c << " ";
}
for (char c : lower)
{
cout << c << " ";
}
}