早教吧作业答案频道 -->其他-->
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语言问题,做错了好几遍描述...的网友还看了以下:
变限积分求道问题对函数f(t+h)-f(t-h)在[-h,h]上的积分对h求导.F(h)=∫[-h 2020-05-23 …
如何求这个卷积积分下的h(t)?f(t)*h(t)=y(t),已知h(t)和y(t),怎样求h(t 2020-06-06 …
讨论:关于如何求卷积x(t)*h(-t)的积分表达式?以前信号与系统里学过了x(t)*h(t)的表 2020-06-06 …
LTI系统响应的零状态响应与冲激响应是什么关系?设LTI系统的冲激响应式h(t),激励为f(t), 2020-06-07 …
推断题:现有如下反应(反应条件均不给),推断物质⑴A→B+C+D⑵C+E→C+F+D⑶D+G→H⑷ 2020-07-30 …
求柱面的方程..准线为f(x,y)=0,z=0;母线的方向向量为s={l,m,n},则柱面的方程f 2020-07-31 …
从t零=0时刻起,用竖直向上的恒力F将质量为m的物体从静止提起,在t时刻,物体上升的高度为h,则在 2020-08-02 …
谁会用下列字母组成三个英语单词???g,a,l,o,ts,t,o,a,o,ha,s,f,t,ks,h 2020-11-01 …
(4七1k•松江区右模)定义:对于函数f(h),若存在非零常数人,T,使函数f(h)对于定义域内的任 2020-12-08 …
设函数f(x)=根号(1-x²)+根号(1+x)+根号(1-x)1.设t=根号(1+x)+根号(1- 2020-12-31 …