어.. 이거 딱봐도 2인데???
해서 바로 2출력했다가 틀렸다.
홀수일 경우를 빼먹어서 홀수인 경우에는 자기자신을 출력하게 했다.
#include <iostream>
using namespace std;
int main() {
int l, r;
cin >> l >> r;
if(l == r)
cout << l;
else
cout<<"2";
}
끝~~
'코드포스' 카테고리의 다른 글
[코드포스 Practice8] 후기 (0) | 2019.12.28 |
---|---|
코드포스 풀기 전 준비사항 (0) | 2019.12.28 |
[코드포스 Practice7] A. A pile of stones (0) | 2019.12.26 |
[코드포스 Practice7] E. Bear and Forgotten Tree 3 (0) | 2019.12.26 |
[코드포스 Practice7] D. Array Splitting (0) | 2019.12.23 |