1055. 欧几里德

Fifnmar
#include <iostream>
int main() {
    unsigned a, b;
    while (scanf("%u%u", &a, &b) != EOF) {
        while (a != b) {
            unsigned c = a % b;
            if (!c)
                break;
            a = b;
            b = c;
        }
        printf("%u\n", b);
    }
}
你当前正在回复 博客/题目
存在问题!