No Rules Rules

젓가락 게임 (feat. 백준, 25642번) 본문

생활/코테

젓가락 게임 (feat. 백준, 25642번)

개발하는 완두콩 2022. 9. 27. 19:55
728x90
반응형

젓가락 게임
https://www.acmicpc.net/problem/25642

 

25642번: 젓가락 게임

용태와 유진이가 게임을 플레이했을 때 용태가 이기게 된다면 yt 를, 유진이가 이긴다면 yj 를 출력한다.

www.acmicpc.net

 

반응형

 

// woohyeon.kim
// kim519620.tistory.com
#include <iostream>
using namespace std;
int main(){
    ios::sync_with_stdio(false), cin.tie(NULL);
    register int A, B;
    cin >> A >> B;
    while(1){
        B += A;
        if(B >= 5){
            cout << "yt";
            break;
        }
        A += B;
        if(A >= 5){
            cout << "yj";
            break;
        }
    }
    return 0;
}
// *&)*@*

 

단순 연산 문제입니다.

728x90
반응형
Comments