I dont know why this gives WA
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
while(1){
string s;
getline(cin,s);
if(s[0]==’*’)break;
stringstream ss(s);
string w;
ss>>w;
char c=tolower(w[0]);
bool f=true;
if(s[0]==’ '||s.length()==0)f=false;
while(ss>>w){
if(w[0]!=c&&w[0]!=toupper(w[0])){f=false;break;}
}
if(f)cout<<“Y”<<"\n";
else
cout<<“N”<<"\n";
}
}