早教吧作业答案频道 -->其他-->
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语言问题,做错了好几遍描述...的网友还看了以下:
用适当的句子补充对话Jim:1.Isthisyourpencilbox?Linda:Yes,2..I 2020-03-31 …
Hello!I’man1girl.2nameisAliceSmith..Aliceismy3nam 2020-05-13 …
e,m,o,n,t,h能组合出什么单词? 2020-05-14 …
1.(1)已知数轴上点M,O,N对应的数分别-3.0.1,点p为数轴上任意一点.如果点p到M,N距 2020-06-06 …
H X T M Y N M X N,B S L什么意思求大神翻译,急求 2020-06-27 …
由代数式的乘法法则类比推导向量的数量积的运算法则:①m•n=n•m类比得到a•b=b•a;②(m+ 2020-06-27 …
由代数式的乘法法则类比推导向量的数量积的运算法则:①“mn=nm”类比得到“•=•”;②“(m+n 2020-06-27 …
数学题急本题满分12分)已知数轴上三点M,O,N对应的数分别为-5,0,1,点P为数轴上任意一点, 2020-07-18 …
某折叠餐桌的使用步骤如图所示,有如图检查项目:项目①:折叠状态下(如图1),检查四条桌腿长相等;项 2020-07-29 …
如图所示,真空中等量同种正点电荷放置在M、N两点,在MN的连线上有对称点a、c,MN连线的中垂线上 2020-07-29 …