-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1140.cpp
More file actions
39 lines (29 loc) · 675 Bytes
/
1140.cpp
File metadata and controls
39 lines (29 loc) · 675 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
string linha;
char aux = ' ';
vector<char> letras;
while(getline(cin, linha)){
if(linha == "*") break;
for(int i=0; i<=linha.size(); i++){
if(aux == ' '){
aux = tolower(linha[i]);
letras.push_back(aux);
} else {
aux = linha[i];
}
}
aux = letras[0];
char res = 'Y';
for(auto l : letras) {
if(aux != l) res = 'N';
}
cout << res << endl;
letras.clear();
aux = ' ';
}
return 0;
}