-
Notifications
You must be signed in to change notification settings - Fork 0
/
uva 12700.cpp
47 lines (36 loc) · 965 Bytes
/
uva 12700.cpp
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
39
40
41
42
43
44
45
46
47
#include<iostream>
#include<string>
#include<cstring>
#include<cstdio>
using namespace std;
int main()
{
int t,n,i,j,k,l,bang,ww,tie,aa;
char word[11];
i=1;
cin>>t;
while(t--)
{
bang=0;
ww=0;
tie=0;
aa=0;
cin>>n;
cin>>word;
for(j=0; j<n; j++)
{
if(word[j]=='W') ww++;
else if(word[j] == 'A') aa++;
else if(word[j]=='B') bang++;
else if(word[j]=='T') tie++;
}
if(aa==n) cout<<"Case "<<i<<": ABANDONED\n";
else if((ww+aa) == n || ww == n && n!=aa) cout<<"Case "<<i<<": WHITEWASH\n";
else if((bang + aa) == n || bang == n && aa!=n) cout<<"Case "<<i<<": BANGLAWASH\n";
else if(bang>ww) cout<<"Case "<<i<<": BANGLADESH "<<bang<<" - "<<ww<<"\n";
else if(ww>bang) cout<<"Case "<<i<<": WWW "<<ww<<" - "<<bang<<"\n";
else if(bang==ww && n!=aa) cout<<"Case "<<i<<": DRAW "<<bang<<" "<<ww<<"\n";
i++;
}
return 0;
}