Submission
Status:
----------
Subtask/Task Score:
0/100
Score: 0
User: Sol2468
Problemset: ตัวอักษรตัวแรกในคำ
Language: cpp
Time: 0.002 second
Submitted On: 2026-10-14 01:45:44
#include <bits/stdc++.h>
using namespace std;
string a ;
vector<char> vowel = {'A','E','I','O','U','a','e','i','o','u','Y','y'} ;
int main(){
ios_base::sync_with_stdio(false) ;
cin.tie(NULL) ;
map<char,int> arr ;
cin >> a ;
for(int i=0 ; i<a.size() ; i++){
arr[a[i]]++ ;
}
for(int i=0 ; i<a.size()-1 ; i++){
if((a[i]=='P'&&a[i+1]=='H')||(a[i]=='S'&&a[i+1]=='H')||(a[i]=='C'&&a[i+1]=='H')){
a.erase(i,2) ;
}
}
cout << a << "\n" ;
for(int i=0 ; i<a.size() ; i++){
if((find(vowel.begin(),vowel.end(),a[i])==vowel.end()) && arr[a[i]]==1){
cout << a[i] ;
break ;
}
}
return 0 ;
}