Pages

Sunday 9 September 2012

UVA - 11172 - Relational Operator


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int cases = s.nextInt();
        int a = 0, b = 0;
        String m="";
        for (int i = 0; i < cases; i++) {
            if(i>0)m+="\n";
            a = s.nextInt();
            b = s.nextInt();
            if (a < b) {
                m+="<";
            } else if (a == b) {
                m+="=";
            } else {
                m+=">";
            }
        }
        System.out.println(m);
    }
}

No comments:

Post a Comment