fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3. int GCD(int a, int b){
  4. if (b == 0) return a;
  5. else return GCD(b, a % b);
  6. }
  7.  
  8. int main() {
  9. int a, b;
  10. cin >> a >> b;
  11. cout << GCD(a,b);
  12. return 0;
  13. }
Success #stdin #stdout 0s 15232KB
stdin
10 5
stdout
5