-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathA and B and Chess.cpp
41 lines (41 loc) · 1010 Bytes
/
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
#include <iostream>
#include <algorithm>
using namespace std;
string a;
int whi, blk;
int main() {
for (int i = 0; i < 8; i++) {
cin >> a;
for (int j = 0; j < 8; j++) {
if (a[j] == 'Q') {
whi += 9;
} else if (a[j] == 'R') {
whi += 5;
} else if (a[j] == 'B') {
whi += 3;
} else if (a[j] == 'N') {
whi += 3;
} else if (a[j] == 'P') {
whi += 1;
} else if (a[j] == 'q') {
blk += 9;
} else if (a[j] == 'r') {
blk += 5;
} else if (a[j] == 'b') {
blk += 3;
} else if (a[j] == 'n') {
blk += 3;
} else if (a[j] == 'p') {
blk += 1;
}
}
}
if (whi > blk) {
cout << "White";
} else if (blk > whi) {
cout << "Black";
} else {
cout << "Draw";
}
return 0;
}