Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- char a[1100],b;
- int n=0,i=0;
- while(1)
- {
- fflush(stdin);
- gets(a);
- strlwr(a);
- if(a[0]=='*')
- break;
- b=a[0];n=0;
- for(i=0;i<strlen(a);i++)
- {
- if(a[i]==' ')
- {
- if(a[i+1]==b)
- {
- i++;
- continue;
- }
- else
- {
- n=1;
- break;
- }
- }
- }
- if(n==0)
- cout<<"Y"<<endl;
- else
- cout<<"N"<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement