-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy path1140.cpp
More file actions
38 lines (36 loc) · 985 Bytes
/
1140.cpp
File metadata and controls
38 lines (36 loc) · 985 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
#include <stdio.h>
#include <string.h>
int main(){
char comp;
char line[1200];
char * pch;
int flag;
while(gets(line)){
if(line[0] == '*') break;
flag = 0;
comp = 32;
pch = strtok (line," ");
while (pch != NULL)
{
if(comp == 32) comp = pch[0];
else{
if(pch[0] >= 65 && pch[0] <= 90){
if(comp == pch[0] || comp == pch[0] + 32){
flag = 0;
}
else flag = 1;
}else{
if(comp == pch[0] || comp == pch[0] - 32){
flag = 0;
}
else flag = 1;
}
}
if(flag == 1) break;
pch = strtok (NULL, " ");
}
if(flag == 1) printf("N\n");
else printf("Y\n");
}
return 0;
}