-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1140.cpp
More file actions
37 lines (34 loc) · 668 Bytes
/
1140.cpp
File metadata and controls
37 lines (34 loc) · 668 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
#include <iostream>
using namespace std;
int main()
{
while(1)
{
string s;
getline(cin,s);
if(s[0]=='*') break;
int size=s.length(),y=0,n=0,count=0;
for(int i=0;i<size;i++)
{
s[i]=tolower(s[i]);
if (s[i]==' ')
{
count++;
}
}
for(int i=0;i<size;i++)
{
if(s[i]==' '&&s[i+1]==s[0])
{
y++;
}
else
{
n++;
}
}
if(count==y) cout<<"Y"<<endl;
else cout<<"N"<<endl;
}
return 0;
}