-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTTENIS
60 lines (51 loc) · 1.2 KB
/
TTENIS
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
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <iostream>
using namespace std;
int main() {
int t,i,win,lose,j;
char a[1000];
cin>>t;
while(t--)
{
cin>>a;
win=lose=0;
for(i=0;a[i]!='\0';i++)
{
if(a[i]=='1')
win+=1;
else
lose+=1;
if(win==10 && lose==10)
{ win=lose=0;
for(j=i+1;a[j]!='\0';j++)
{ //cout<<"j= "<<j<<endl;
if(a[j]=='1')
{ win+=1;
//cout<<"win"<<endl;
}
else{
lose+=1;
//cout<<"lose"<<endl;
}
//out<<"win = "<<win<<"lose = "<<lose<<endl;
if(win-lose==2)
{ cout<<"WIN"<<endl;
break;}
else if (lose-win==2){
cout<<"LOSE"<<endl;
break;
}
}
break;
}
else if(win==11){
cout<<"WIN"<<endl;
break;
}
else if(lose==11){
cout<<"LOSE"<<endl;
break;
}
}
}
return 0;
}