#include <iostream> using namespace std; int main() { int a , b ; while(cin >> a >> b) { int Poor = 0 /*差*/ ; while(b!=0) { Poor = a % b ; // 類似 a-b = 0 時 , break a = b ; b = Poor ; } cout << a << endl ; } return 0; }