-
Notifications
You must be signed in to change notification settings - Fork 590
/
Copy pathBPL Mubarak!11.cpp
43 lines (43 loc) · 914 Bytes
/
BPL Mubarak!11.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
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
string s;
cin>>s;
int count=0,ans=0;
for(int i=0; i<s.size(); i++)
{
if(s[i]=='W' || s[i]=='D' || s[i]=='N')
continue;
else
{
count++;
}
if(count==6)
{
ans++;
count=0;
}
}
string ab,bc;
if(count>1)
bc="BALLS";
else if(count==1)
bc="BALL";
if(ans==1)
ab="OVER";
else if(ans>1)
ab="OVERS";
if(ans!=0 && count!=0 )
cout<<ans<<" "<<ab<<" "<<count<<" "<<bc<<endl;
else if(ans!=0 && count==0)
cout<<ans<<" "<<ab<<endl;
else
cout<<count<<" "<<bc<<endl;
}
return 0;
}