Codeforces 707A. Brain's Photos

题目链接:http://codeforces.com/problemset/problem/707/A

题意:

  给你一个 n * m 的照片, 让你判断这个照片是否是黑白的,其中如果一个照片仅由"W", "B", "G"组成, 那么就可以说它是黑白的.

代码:

 1 #include <bits/stdc++.h>
 2 
 3 using namespace std;
 4 
 5 typedef long long LL;
 6 const double PI = acos(-1);
 7 
 8 int main() {
 9     ios_base::sync_with_stdio(0); cin.tie(0);
10     int n, m; cin >> n >> m;
11     char c;
12     int ok = 0;
13     for(int i = 0; i < n; i++) {
14         for(int j = 0; j < m; j++) {
15             cin >> c;
16             if(c != 'W' && c != 'B' && c != 'G') ok = 1;
17         }
18     }
19     if(!ok) cout << "#Black&White" <<endl;
20     else cout << "#Color" <<endl;
21     return 0;
22 }
原文地址:https://www.cnblogs.com/Ash-ly/p/5828276.html