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 A if Alice is taller than Bob, else output B. The output is case insensitive, i.e, both A and a will be accepted as correct answers when Alice is taller.

Constraints

  • 1≤�≤1000
  • 100≤�,�≤200
  • �≠�

Sample 1:

Input
 
Output
 
2
150 160
160 150
B
A

Explanation:

Test case 1: In this case, 150<160 so Bob is taller than Alice.

Test case 2: In this case, 160>150 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

x
+
cmd
2 150 160 160 150

Output

x
+
cmd
B A
Advertisements

Demonstration


CodeChef   solution TALLER  - Who is taller! CodeChef   solution  in C,C++

Previous
CodeChef solution AUDIBLE - Audible Range solution Codechef solution in C,C++
Next
CodeChef solution REACHTARGET - Reach the Target Codechef solution in C,C++