早教吧作业答案频道 -->其他-->
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
我的大脑
描述
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;
}
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;
}
看了 c语言问题,做错了好几遍描述...的网友还看了以下:
按顺序.1氢(qīng)氦(hài)锂(lǐ)铍(pí)硼(péng)2碳(tàn)氮(dàn)氧 2020-05-13 …
有会越南语的吗?请问”我会在远方祝福你“用越南语怎么说?”ở một nơi xa tôi vẫn 2020-05-17 …
用以下英文宇母填在上a,a,a,a,a,a,b,e,e,d,e,e,e,e,e,e,f,g,g用以 2020-06-24 …
化学前二十个元素的化学反应分别是什么?前二十个元素的顺序是不是这样(有错误麻烦纠正):氢(qīng 2020-07-05 …
n-C3H7-H,i-C3H7-H这两个碳氢键是分别指CH3CH2CH2-H键和CH3-CH(CH 2020-07-07 …
英语单词填空1.时间状语:d-r-n-2.场所:b-s-s-o-f-r--e-a-t-e-t3.教 2020-07-14 …
看音标写单词/kli:n//i:t//tri://spi:k//li:v//i’reisの//θi 2020-07-19 …
在资金时间价值计算时,i和n给定,下列等式中正确的有().A.(F/A,i,n)=[(P/F,i,n 2021-01-14 …
1、在资金时间价值计算时,i和n给定,下列等式中正确的有?为什么?1、A(F/A,i,n)=[(P/ 2021-01-14 …
英文单词分类填空动物类1.O()t()p()s2.k()t()e()3.l()b()t()r4.a( 2021-02-05 …