Last active
May 14, 2016 08:53
-
-
Save cthbst/21489701c02d5308c8cf10b5147aeaf1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std ; | |
int main(){ | |
int a ,b ; | |
while (cin >> a >> b ){ | |
int ans = 1 ; | |
for (int i=2 ;i<=a && i<=b ;i++ ){ | |
if (a%i==0 && b%i==0){ | |
ans=i ; | |
} | |
} | |
cout << ans <<endl ; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment