반응형
#include<iostream>
#include<stdio.h>
using namespace std;
int main(int argc, char** argv)
{
int test_case;
int T;
int a, b;
cin>>T;
for(test_case = 1; test_case <= T; ++test_case)
{
a = 0;
b = 0;
scanf("%d %d", &a, &b);
if( a > b)
printf("#%d >\n", test_case);
else if( a == b)
printf("#%d =\n", test_case);
else
printf("#%d <\n", test_case);
}
return 0;//정상종료시 반드시 0을 리턴해야합니다.
}
1. 같다를 비교할떈 등호 두 개...
2. 문자열로 기본으로 하나 설정 후 char res = '=' 다른 두 조건( > , <) 일 때 res를 변경 하는 방식도 있다.
반응형
'개인공부 > Algorithm(C, C++)' 카테고리의 다른 글
SW Expert Academy(2063. 중간값 찾기) C++ (0) | 2021.08.10 |
---|---|
SW Expert Academy(2068. 최대수 구하기) C++ (0) | 2021.08.10 |
C++ iomanip 헤더, 소수점 자리 출력 fixed (0) | 2021.07.02 |
C++ Sort (String 정렬) (0) | 2021.06.14 |
Programmers 체육복문제 (Greedy) (0) | 2020.09.24 |