-
Notifications
You must be signed in to change notification settings - Fork 7
/
519 A- A and B and Chess.cpp
82 lines (75 loc) · 1.14 KB
/
519 A- A and B and Chess.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#include<iostream>
using namespace std;
int main()
{
string s[100];
int t=0,t1=0;
for(int i=0;100>i;i++)
{
cin>>s[i];
}
for(int i=0;100>i;i++)
{
for(int j=0;i>j;j++)
{
if(s[i][j]=='.')
{
continue;
}
if(s[i][j]=='Q')
{
t=t+9;
}
if(s[i][j]=='R')
{
t=t+5;
}
if(s[i][j]=='B')
{
t=t+3;
}
if(s[i][j]=='N')
{
t=t+3;
}
if(s[i][j]=='P')
{
t=t+1;
}
if(s[i][j]=='q')
{
t1=t1+9;
}
if(s[i][j]=='r')
{
t1=t1+5;
}
if(s[i][j]=='b')
{
t1=t1+3;
}
if(s[i][j]=='n')
{
t1=t1+3;
}
if(s[i][j]=='p')
{
t1=t1+1;
}
}
}
if(t>t1)
{
cout<<"White";
}
if(t1>t)
{
cout<<"Black";
}
if(t1==t)
{
cout<<"Draw";
}
cout<<t1<<" "<<t;
return 0;
}