-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy path2539.cpp
52 lines (52 loc) · 942 Bytes
/
2539.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
48
49
50
51
52
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdlib>
#include<iomanip>
#include<vector>
#include<list>
#include<map>
#include<queue>
#include<algorithm>
typedef long long LL;
using namespace std;
int a[50];
int main()
{
int n;
while(cin>>n,n)
{
getchar();
int t=(n+1)/2;
memset(a,-1,sizeof(a));
for(int i=0;i<n;i++)
{
string s;
getline(cin,s);
int len=s.size();
if(s.find(" no good")==len-8) a[i]=0;
else a[i]=1;
}
for(int i=1;i<=t;i++)
cout<<i<<' ';
cout<<"Score"<<endl;
int q=0;
for(int i=0;i<n;i+=2){
if(a[i]==1) cout<<'O'<<' ', q++;
else cout<<'X'<<' ';
}
cout<<q<<endl;
q=0;
for(int i=1;i<t*2;i+=2)
{
if(a[i]==-1) cout<<'-'<<' ';
else if(a[i]) cout<<'O'<<' ',q++;
else cout<<'X'<<' ';
}
cout<<q<<endl;
}
return 0;
}