문제1410--Relational Operators

1410: Relational Operators

실행시간 제한: 10 Sec  메모리사용 제한: 128 MB
제출: 11  통과: 11
[제출] [채점기록] [묻고답하기]

문제 설명

The relational operators in C programming language are shown in the table below. Of course the last two are also known as equality operators.

No Operator Meaning
1 > Greater Than
2 >= Greater Than or Equal to
3 < Less than
4 <= Less than or Equal
5 == Equal
6 != Not Equal

These operators compare the value of the two operands it is working on (The value on its left and the value on its right) and returns true orfalse (one or zero). For example value of 2 > 3 is interpreted as "false" (As 2 is actually less than 3), value of 3 != 4 is interpreted as trueand value of 3 >= 3 is also interpreted as true. You have to find out this interpretation using a program.

입력 설명

The input file contains around 12000 line of input. Each line contains two integers a and b separated by an operator ">", ">=", "<", "<=", "==" or "!=". Input is terminated by a line which contains an "E" instead of the operators. Note that there is also a space between any operator and operand. You can assume (- 10000 ≦ a≦ 10000).

출력 설명

For each line of input produce one line of output. This line contains the serial of output followed by a string "true" or "false" (without the quotes) which denotes how the expression is interpreted in C language. Look at the output for sample input for details.

입력 예시 Copy

3 != 3
4 < 4 
4 <= 5
3 E 3

출력 예시 Copy

Case 1: false 
Case 2: false 
Case 3: true

출처/분류