algorithm/기초다지기
523 : 연산자 - 자가진단6
m0nd2y
2018. 2. 28. 14:28
523 : 연산자 - 자가진단6

두 개의 정수를 입력받아서 다음과 같이 4가지 관계연산자의 결과를 출력하시오.
이때 입력받은 두 정수를 이용하여 출력하시오.
(JAVA는 1이면 true, 0이면 false를 출력한다.)
![]() 4 5 | ![]() 4 > 5 --- 0 4 < 5 --- 1 4 >= 5 --- 0 4 <= 5 --- 1 |
-----해설-----
/************************************************************** Problem: 523 User: ldj6192 Language: C++ Result: Success Time:0 ms Memory:1092 kb ****************************************************************/ #includeint main() { int a, b; int result1, result2, result3, result4; scanf("%d %d", &a, &b); result1 = (a > b); result2 = (a < b); result3 = (a >= b); result4 = (a <= b); printf("%d > %d --- %d \n", a, b, result1); printf("%d < %d --- %d \n", a, b, result2); printf("%d >= %d --- %d \n", a, b, result3); printf("%d <= %d --- %d \n", a, b, result4); return 0; }