# UVa 11172 ### 題目連結:[UVa11172](http://domen111.github.io/UVa-Easy-Viewer/?11172) ### 題述: #### 有些運算子(operator)是用來檢查兩個數值之間的關係,這種運算子稱為關係運算子(relational operators)。 給你兩個數值你的工作就是要找出它們之間的關係是 #### (1)第一個大於第二個 (2)第二個小於第一個 (3)兩個一樣大。 #### 輸入的第一列有一個整數代表共有多少組測試資料。 #### 接下來每列有兩個整數 a 和 b ( |a|,|b| < 1000000001)。 ### c++ code: ```cpp= #include<iostream> #include<algorithm> using namespace std; int main() { //------------------------------------------------ #ifdef local freopen("UVain.txt","r",stdin); freopen("UVaout.txt","w",stdout); #endif //------------------------------------------------ int n; cin >> n ; long long a , b ; while ( n > 0 ) { cin >> a >> b ; if ( a > b ) { cout << ">" << endl ; } else if ( b > a ) { cout << "<" << endl ; } else if ( a = b ) { cout << "=" << endl ; } n-=1 ; } } ``` :::success **``sample input``** 3 10 20 20 10 10 10 ::: :::success **``sample output``** < \> \= ::: #### [返回首頁](https://hackmd.io/@fkleofk/APCS#11172) ###### tags: `APCS選修` `C++` `UVa`