[ 문제 ]
Zombies love to eat brains. Yum.
[ 입력 ]
The first line contains a single integer n 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.
[ 출력 ]
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".
[ 작성한 코드 ]
#include <stdio.h>
int main()
{
int n,x,y,i;
scanf("%d",&n);
for(i = 0; i < n; i++)
{
scanf("%d %d",&x,&y);
if(x<y)
{
printf("NO BRAINS\n");
}
else if(x>=y)
{
printf("MMM BRAINS\n");
}
}
}
단순한 입력값 비교 문제라 어려움 없이 풀이를 할 수 있었다.
알고리즘 분류
- 구현
'백준 알고리즘 코딩' 카테고리의 다른 글
[C언어] 백준 1259번 팰린드롬수 (0) | 2025.03.25 |
---|---|
[C언어] 백준 4892번 숫자 맞추기 게임 (0) | 2025.03.25 |
[C언어] 백준 4101번 크냐? (0) | 2025.03.24 |
[C언어] 백준 2753번 윤년 (0) | 2025.03.24 |
[C언어] 백준 2752번 세수정렬 (0) | 2025.03.23 |