안녕하세요. 오늘은 싸울거예요.

문제

https://www.acmicpc.net/problem/30455

아이디어

간단히 N이 홀수면 Goose, 짝수면 Duck을 출력하면 됩니다.

소스코드

#include <iostream>
using namespace std;

int main(void)
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int N;
    cin >> N;
    if (N % 2 == 1) cout << "Goose";
    else cout << "Duck";
}


감사합니다.

0개의 댓글