Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- string a;
- while(1)
- {
- int cont=0, x=0, numP=0, letras=0;
- char v[100];
- getline(cin, a);
- for(int i=0; i<a.size(); i++)
- {
- if(a[i]>='a' && a[i]<='z')
- {
- a[i]=toupper(a[i]);
- }
- }
- if(a == "*") break;
- for(int i=0; i<a.size(); i++)
- {
- cont++;
- if(a[i]==' ')
- {
- cont = 0;
- numP++;
- }
- if(cont == 1)
- {
- if(a[0] == a[i])
- letras++;
- }
- }
- if(numP+1 == letras)
- cout << "Y" << endl;
- else
- cout << "N" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement