Submission
Status:
P-PPPPPP-P
Subtask/Task Score:
80/100
Score: 80
User: chypnx
Problemset: ตัวอักษรตัวแรกในคำ
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-03 23:08:18
#include <bits/stdc++.h>
using namespace std;
int main(){
string txt;
cin >> txt;
sort(txt.begin(),txt.end());
if (txt.length() == 1){
cout << txt[0];
}else{
for(int i =1; i< txt.length(); i++){
if(txt[i] == txt[i-1]){
txt.erase(i-1, txt.find_first_not_of(txt[i]));
}
}
cout << txt[0];
}
return 0;
}