fork download
  1. #include<iostream>
  2. using namespace std;
  3. int NWD(int,int);
  4. int main()
  5. {
  6. cout<<NWD(6,27)<<'\n';
  7. return 0;
  8. }
  9. int NWD(int a,int b)
  10. {
  11. if(a!=b)
  12. {
  13. if(a>b) NWD(a-b,b);
  14. else NWD(a,b-a);
  15. }
  16. else
  17. return a;
  18. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
6