SHARE
TWEET

Untitled

a guest Jun 18th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     freopen("Ain.txt", "r", stdin);
  6.     freopen("Aout.txt", "w", stdout);
  7.  
  8.     int i, len, t, caseno = 0, dot, B;
  9.     scanf("%d", &t);
  10.     string s;
  11.  
  12.     while(t--)
  13.     {
  14.         cin >> s;
  15.         len = s.size();
  16.         dot = B = 0;
  17.         for(i = 1; i < len; i++)
  18.         {
  19.             if(s[i] == 'B')
  20.                 B++;
  21.             else if(s[i] == '.')
  22.                 dot++;
  23.         }
  24.         printf("Case #%d: ", ++caseno);
  25.         if(!dot || !B)
  26.         {
  27.             printf("N\n");
  28.             continue;
  29.         }
  30.         dot > B? printf("N\n") : printf("Y\n");
  31.     }
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top