Skip to content

Instantly share code, notes, and snippets.

@alvineadel
Last active December 30, 2015 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alvineadel/7817897 to your computer and use it in GitHub Desktop.
Save alvineadel/7817897 to your computer and use it in GitHub Desktop.
UVA - 11172 - Relational Operators

Problem H
Relational Operators
Input: Standard Input

Output: Standard Output

 

Some operators checks about the relationship between two values and these operators are called relational operators. Given two numerical values your job is just to find out the relationship between them that is (i) First one is greater than the second (ii) First one is less than the second or (iii) First and second one is equal.

 

Input

First line of the input file is an integer t (t<15) which denotes how many sets of inputs are there. Each of the next t lines contain two integers a and b (|a|,|b|<1000000001).

 

Output

For each line of input produce one line of output. This line contains any one of the relational operators “>”, “<” or “=”, which indicates the relation that is appropriate for the given two numbers.

 

Sample Input      Output for Sample Input

3
10 20
20 10
10 10

=

 


Problem-setter: Shahriar Manzoor

 

import java.util.*;
public class Main{
public static void main (String[] args) throws java.lang.Exception
{
Scanner in = new Scanner(System.in);
int N = in.nextInt();
while(N-- !=0){
int a=in.nextInt(), b=in.nextInt();
if(a<b)
System.out.println("<");
if(a==b)
System.out.println("<");
if(a>b)
System.out.println("<");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment