A. Brain's Photos
题意: 给你一个n*m的字符矩阵,如果字符中出现'C', 'M', 'Y'这三个中的任何一个就输出"#Color";否则输出"#Black&White".
代码如下:
1 #include <iostream>
2 #include <cstdio>
3 #include <cstring>
4 #include <fstream>
5 #include <ctime>
6 #include <cmath>
7 #include <cstdlib>
8 #include <algorithm>
9 #include <set>
10 #include <map>
11 #include <list>
12 #include <stack>
13 #include <queue>
14 #include <iterator>
15 #include <vector>
16
17 using namespace std;
18
19 #define LL long long
20 #define INF 0x3f3f3f3f
21 #define MOD 1000000007
22 #define MAXN 10000010
23 #define MAXM 1000010
24 #define inf 0x7fffffffffffffff
25 #define maxf 0x7fffffff
26
27 const int maxn = 105;
28 char s[maxn][maxn];
29
30 int main()
31 {
32 int n, m;
33 while(scanf("%d%d", &n, &m)==2)
34 {
35 getchar();
36 int flag = 0;
37 for(int i = 0; i < n; i++ )
38 gets(s[i]);
39 for(int i = 0; i < n; i++ )
40 for(int j = 0; s[i][j]!='