-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday28.cpp
More file actions
39 lines (36 loc) · 914 Bytes
/
day28.cpp
File metadata and controls
39 lines (36 loc) · 914 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 <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include<string>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int t;
cin >> t;
string s1 = "qwertyuiop";
string s2 = "asdfghjkl";
string s3 = "zxcvbnm";
while (t--) {
string s;
cin >> s;
bool flag = false;
for (size_t i = 0; i < s.length(); i++) {
s[i] = tolower(s[i]);
}
if (s.find_first_not_of(s1) == string::npos) {
flag = true;
} else if (s.find_first_not_of(s2) == string::npos) {
flag = true;
} else if (s.find_first_not_of(s3) == string::npos) {
flag = true;
}
if (flag) {
cout << "yes" << endl;
} else {
cout << "no" << endl;
}
}
return 0;
}