First, solve the problem. Then, write the code. ” - John Johnson

It's not at all important to get it right the first time. It's vitally important to get it right the last time. ” - Andrew Hunt and David Thomas

Wednesday, July 16, 2014

Relational Operator.

Author : Jisan
Programming language : Java
Difficulty : Easy
Status : Accepted
Problem number : UVA-11172
http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=2113

Code:

import java.util.*;
public class Uva_11172 {
    public static void main (String chayapoth[]){
        Scanner input = new Scanner(System.in);
        int testcase;
        testcase = input.nextInt();
        long a;
        long b;
        while(testcase>0) {

            a = input.nextInt();
            b = input.nextInt();

              if(a < b)
                  System.out.println("<");
              else if (a > b)
                  System.out.println(">");
              else if (a == b)
                  System.out.println("=");


            testcase--;
        }
    }
}

No comments:

Post a Comment