FZU 2151 OOXX Game

来源:互联网 发布:mab软件 编辑:程序博客网 时间:2024/06/04 19:51
L - OOXX Game

题目链接

题意和题目思路很简单:如‘O’的数量为奇数为 “Maze”,否则为"Fat brother";

/**   author:liuwen*/#include <iostream>#include <cstdio>#include <map>#include <algorithm>using namespace std;int main(){   // freopen("in.txt","r",stdin);    int T,cas=0;    scanf("%d",&T);    while(T--){        int zero=0;        int n,m;        scanf("%d%d",&n,&m);        for(int i=1;i<=n;i++){            for(int j=1;j<=m;j++){                char ch;                cin>>ch;                if(ch=='O') zero++;            }        }        if(zero%2)  printf("Case %d: Maze\n",++cas);        else    printf("Case %d: Fat brother\n",++cas);    }    return 0;}


0 0