Submission
Status:
[PPPPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: DontYouGetItIHaveYouCornered
Problemset: เรียงสตริง
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-01 14:41:18
#include <iostream>
#include <algorithm>
#include <string>
int main() {
std::string msg;
std::cin >> msg;
int length = msg.length();
int newmsg[length];
for (int index = 0; index < length; index++){
newmsg[index] = msg[index];
}
std::sort(&newmsg[0], &newmsg[length]);
int prevNum = (newmsg[0] - 1);
for (int index = 0; index < length; index++){
if (newmsg[index] == prevNum) {continue;}
std::cout << char(newmsg[index]) << " ";
prevNum = newmsg[index];
}
}