24h購物| | PChome| 登入
2012-01-12 19:44:33| 人氣575| 回應0 | 上一篇 | 下一篇

[UVA] 11172 - Relational Operator

推薦 0 收藏 0 轉貼0 訂閱站台

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

=

 





#include<stdio.h>
int main() {
    int T, x, y;
    scanf("%d", &T);
    while(T--) {
        scanf("%d %d", &x, &y);
        if(x < y)        puts("<");
        else if(x > y)    puts(">");
        else    puts("=");
    }
    return 0;
}

台長: Morris
人氣(575) | 回應(0)| 推薦 (0)| 收藏 (0)| 轉寄
全站分類: 不分類 | 個人分類: UVA |
此分類下一篇:[UVA] 10327 - Flip Sort
此分類上一篇:[UVA] 11185 - Ternary

是 (若未登入"個人新聞台帳號"則看不到回覆唷!)
* 請輸入識別碼:
請輸入圖片中算式的結果(可能為0) 
(有*為必填)
TOP
詳全文