Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- freopen("leapfrog_ch_.txt", "r", stdin);
- freopen("IUT 0044 output.txt", "w", stdout);
- int x, t, i, cnt=0, j, m=0;
- cin>>t;
- string a;
- for(j=1; j<=t; j++)
- {
- cnt=0;
- m=0;
- cin>>a;
- x=a.size();
- if(x<=2)
- printf("Case #%d: N\n", j);
- else if(x>2)
- {
- for(i=0; i<x; i++)
- {
- if(a[i]=='B')
- cnt++;
- if(a[i]=='A' && a[i+1]=='.' && a[i+2]=='.')
- m++;
- }
- if(m==0 && cnt>=x/2 && cnt<=x-2)
- printf("Case #%d: Y\n", j);
- else
- printf("Case #%d: N\n", j);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement