Algorithm
problem Link : https://www.codechef.com/problems/TALLER
Problem
Alice and Bob were having an argument about which of them is taller than the other. Charlie got irritated by the argument, and decided to settle the matter once and for all.
Charlie measured the heights of Alice and Bob, and got to know that Alice's height is centimeters and Bob's height is centimeters. Help Charlie decide who is taller.
It is guaranteed that .
Input Format
- The first line of input will contain an integer — the number of test cases. The description of test cases follows.
- The first and only line of each test case contains two integers and , as described in the problem statement.
Output Format
For each test case, output on a new line if Alice is taller than Bob, else output . The output is case insensitive, i.e, both and will be accepted as correct answers when Alice is taller.
Constraints
Sample 1:
2 150 160 160 150
B A
Explanation:
Test case : In this case, so Bob is taller than Alice.
Test case : In this case, so Alice is taller than Bob.
Code Examples
#1 Code Example with C Programming
Code -
C Programming
#include<stdio.h>
int main()
{
int t,a,b;
scanf("%d",&t);
if(t>=1 && t<=1000)
{
while(t--)
{
scanf("%d %d",&a,&b>;
if(a>=100 && a < =200 && b>=100 & b<=200)
{
if(a>b) printf("A\n");
if(a<b) printf("B\n">;
}
}
}
}
Copy The Code &
Try With Live Editor
Input
Output
Demonstration
CodeChef solution TALLER - Who is taller! CodeChef solution in C,C++