알고리즘
[C++] 백준 9659번 돌 게임 5
J3SUNG
2019. 9. 18. 10:53
728x90
마지막 돌을 가져가는 사람이 이기게 됩니다.
n이 2로 나누어떨어질 경우 창영이가 이기고
n이 2로 나누어떨어지지 않을 경우 상근이가 이깁니다.
#include <iostream>
#include <algorithm>
using namespace std;
int main(int argc, char* argv[])
{
long long n;
cin >> n;
if (n % 2 == 1) {
cout << "SK" << endl;
}
else {
cout << "CY" << endl;
}
return 0;
}