SWEA 17937 큰 수의 최대공약수

Jmnote (토론 | 기여)님의 2023년 10월 30일 (월) 20:50 판 (→‎C++)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요[ | ]

SWEA 17937 큰 수의 최대공약수

2 C++[ | ]

#include <iostream>
using namespace std;

string A, B;

string solve() {
    return (A == B) ? A : "1";
}

int main(int argc, char** argv) {
	int test_case;
	int T;
    cin >> T;
    for(test_case = 1; test_case <= T; ++test_case) {
        cin >> A >> B;
        cout << '#' << test_case << ' ' << solve() << '\n';
    }
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}