Skip to content

Instantly share code, notes, and snippets.

@cthbst
Created May 14, 2016 08:54
Show Gist options
  • Save cthbst/7d95df5d1a9709dce9f2dd021ac5b7f7 to your computer and use it in GitHub Desktop.
Save cthbst/7d95df5d1a9709dce9f2dd021ac5b7f7 to your computer and use it in GitHub Desktop.
#include<iostream>
using namespace std ;
int gcd(int a ,int b ){
if (b==0)return a ;
return gcd(b,a%b) ;
}
int main(){
int a ,b ;
while (cin >> a >> b ){
cout << gcd(a,b) <<endl ;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment