Submission

Status:

[PPPPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: emipp

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-10 02:11:15

#include<iostream>
#include<string.h>
using namespace std ;
char name[31] ;
int main () {
    cin >> name ;
    int y ;
    y = strlen(name) ;
    for (int i = 0 ; i < y-1 ; i++){
        for(int j = 0 ; j <y-1-i ; j++)
        if (name[j] > name[j+1]) 
        swap(name[j],name[j+1]);
    }
   
    cout << name[0] << " " ;
    for (int i = 1 ; i <y ; i++){
        if(name[i] != name[i-1])
        cout << name[i] << " " ;
    }
    return 0 ;
}