Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string line;
- char cs, cc;
- bool flag;
- while(true) {
- getline(cin, line);
- if(line[0] == '*') break;
- flag = true;
- (line[0] > 64 && line[0] < 91) ? cc = line[0], cs = cc + 32 : cs = line[0], cc = cs - 32;
- for(int i = 0; line[i]; i++)
- if(line[i] == ' ')
- if(line[i + 1] != cs && line[i + 1] != cc) {
- flag = false;
- break;
- }
- flag ? cout << "Y" << endl : cout << "N" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement