코딩테스트/프로그래머스 - LV 0

[프로그래머스] 홀짝 구분하기

웅드 2024. 1. 22. 17:19

 

 

 

  • 풀이
#include <iostream>

using namespace std;

int main(void) {
    int n;
    cin >> n;
    if( n % 2 == 1) cout << n << " is odd";
    else cout << n << " is even";
    return 0;
}
반응형