题目地址:http://codeforces.com/contest/519/problem/A
1 /* 2 水题 3 */ 4 #include <cstdio> 5 #include <algorithm> 6 #include <iostream> 7 #include <cstring> 8 #include <string> 9 using namespace std; 10 11 const int maxn = 1e6 + 10; 12 int a[maxn]; 13 14 int main(void) 15 { 16 //freopen ("A.in", "r", stdin); 17 18 string s1; 19 int suma = 0; int sumb = 0; 20 for (int i=1; i<=8; ++i) 21 { 22 cin >> s1; 23 for (int j=0; s1[j]!='\0'; ++j) 24 { 25 if (s1[j] == '.') continue; 26 else if (s1[j] == 'Q') suma += 9; 27 else if (s1[j] == 'R') suma += 5; 28 else if (s1[j] == 'B') suma += 3; 29 else if (s1[j] == 'N') suma += 3; 30 else if (s1[j] == 'P') suma += 1; 31 else if (s1[j] == 'q') sumb += 9; 32 else if (s1[j] == 'r') sumb += 5; 33 else if (s1[j] == 'b') sumb += 3; 34 else if (s1[j] == 'n') sumb += 3; 35 else if (s1[j] == 'p') sumb += 1; 36 } 37 } 38 39 if (suma > sumb) cout << "White" << endl; 40 else if (suma < sumb) cout << "Black" << endl; 41 else cout << "Draw" << endl; 42 43 return 0; 44 }