早教吧 育儿知识 作业答案 考试题库 百科 知识分享

c语言问题,做错了好几遍描述Zombieslovetoeatbrains.Yum.僵尸喜欢吃脑子。百胜餐饮集团。Input输入Thefirstlinecontainsasingleintegernindicatingthenumberofdatasets.第一行包含一个整数N表示数据集

题目详情
c语言问题,做错了好几遍
描述
Zombies love to eat brains. Yum.
僵尸喜欢吃脑子。百胜餐饮集团。
Input
输入
The first line contains a single integer n indicating the number of data sets.
第一行包含一个整数N表示数据集的数目。
The following n lines each represent a data set. Each data set will be formatted according to the following description:
以下N行每行代表一个数据集。每个数据集的格式如下:
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.
一个单一的数据集由一个线“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”,如果大脑的僵尸吃数大于或等于大脑的数量需要活僵尸。否则,该线将“无脑”。
Sample Input
样本输入
3
3
4 5
4 5
3 3
3 3
4 3
4 3
Sample Output
样本输出
NO BRAINS
没有头脑的
MMM BRAINS
我的大脑
MMM BRAINS
我的大脑
▼优质解答
答案和解析
#include
int main()
{
int t,x,y;
scanf("%d",&t);
while(t--)
{
scanf("%d%d",&x,&y);
if(x>=y)puts("MMM BRAINS");
else puts("NO BRAINS");
}
return 0;
}