Skip to content
Archive

UVa Online Judge Challenge "11172"

“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.”

UVa Online Judge Challenge "11172"

Problem

My solution

import java.util.Scanner;

class Main {

    public static void main(String[] args) {

        int a, b, t;

        Scanner sc = new Scanner(System.in);
        t = sc.nextInt();
        sc.nextLine();

        while (t > 0) {
            String temp = sc.nextLine();
            String[] str_array = temp.split(" ");
            a = Integer.parseInt(str_array[0]);
            b = Integer.parseInt(str_array[1]);

            if (a > b) {
                System.out.println(">");
            } else if (a < b) {
                System.out.println("<");
            } else {
                System.out.println("=");
            }
            t--;
        }
    }
}

Related Reading

Related entries

Selected from shared tags, categories, and nearby entries in the same section.

Relationship Map

Connected Memory

This relationship map centers on the current entry and highlights connected categories and tags.

Categories 0
Tags 0
Entries 0