C++题 怎么解决x,y的范围问题 是10的101次幂

C++题 怎么解决x,y的范围问题 是10的101次幂
Introduction:
Zombies love to eat brains.Yum.
Input:
The first line contains a single integer n (n ≤ 20) indicating the number of data sets.
The following n lines each represent a data set.Each data set will be formatted according to the following description:
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 < 10101
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".
Sample Input:
3
4 5
3 3
4 3
Sample Output:
NO BRAINS
MMM BRAINS
MMM BRAINS
我是新手哦 1年前 已收到1个回答 举报

快乐蜻蜓 幼苗

共回答了23个问题采纳率:95.7% 举报

#include
int main()
{
int i;
int N,x,y;
scanf("%d",&N);
for(i=0;i=y) printf("MMM BRAINSn");
else printf("NO BRAINSn");
}
}

1年前 追问

1

我是新手哦 举报

不对 x,y的范围是10的101次幂不是10101

举报 快乐蜻蜓

改用字符串存储,应该就行了。 #include #include void main() { char x[103],y[103]; int l_x,l_y; int N,i; scanf("%d",&N); for(i=0;il_y) printf("MMM BRAINSn"); else if(l_x
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 17 q. 0.020 s. - webmaster@yulucn.com