Submission
Status:
P----PPP--
Subtask/Task Score:
40/100
Score: 40
User: chypnx
Problemset: ตัวอักษรตัวแรกในคำ
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-03 16:52:59
#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,1);
}
}
}
cout << txt[0];
return 0;
}