fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. int a = 54, b = 32;
  7.  
  8. int r;
  9. do {
  10. r = a % b;
  11. a = b;
  12. b = r;
  13. } while (r > 0);
  14.  
  15. cout << "gcd = " << a << endl;
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5532KB
stdin
Standard input is empty
stdout
gcd = 2