Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: MyYammGods
Problemset: ตัวอักษรตัวแรกในคำ
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-05 21:26:31
#include <bits/stdc++.h>
using namespace std;
int main (){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string word;
cin >> word;
int position[30] = {0};
int count[30] {0};
for(int i=0;i<word.size();i++){
position[word[i] - 'A'] = 1;
count[word[i]-'A']++;
}
for(int i=0;i<27;i++){
if(position[i]==1&&count[i]==1){
cout << (char)(i + 'A');
break;
}
}
}