当前位置: 代码迷 >> 综合 >> oj-杭电 No Brainer
  详细解决方案

oj-杭电 No Brainer

热度:46   发布时间:2024-01-28 08:28:05.0

翻译:

Zombies love to eat brains. Yum.僵尸爱吃的大脑

Input

The first line contains a single integer n indicating the number of data sets. <br> <br>The following n lines each represent a data set. Each data set will be formatted according to the following description: <br> <br>A single data set consists of a line "X Y", where X is the number of brains the zombie eats and Y is the number of brains the zombie requires to stay alive. <br>

第一行包含一个整数 n,表示数据集的数量。下面的 n 行代表一个数据集,每个数据集将根据以下描述格式化:一个单独的数据集由一行 x y 组成:X 代表僵尸吃掉的脑子数量,Y 是僵尸生存所需的大脑数量。

Output

For each data set, there will be exactly one line of output. This line will be "MMM BRAINS" if the number of brains the zombie eats is greater than or equal to the number of brains the zombie requires to stay alive. Otherwise, the line will be "NO BRAINS”

对于每个数据集,只有一行输出。如果僵尸吃大脑数量大于或等于僵尸的大脑数量这个答案是MMM BRAINS,反之是NO BRAINS

 

Sample Input

3

4 5

3 3

4 3

Sample Output

NO BRAINS

MMM BRAINS

MMM BRAINS

 

思路:

如果输入的x>=y,就输出MMM。。。

反之输出NO。。。

 

代码:

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{int n;scanf("%d",&n);while(n--){int X,Y;scanf("%d %d",&X,&Y);if(X>=Y)printf("MMM BRAINS\n");elseprintf("NO BRAINS\n");}return 0;
}

 

  相关解决方案