fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int nwd(int a, int b) {
  5. while (b !=0) {
  6. int pom = b;
  7. b = a % b;
  8. a = pom;
  9. }
  10. return a;
  11. }
  12.  
  13. int rzad(int goscie, int gospodarze) {
  14. return nwd(goscie, gospodarze);
  15. }
  16. int main() {
  17. cout << rzad(72, 90) << " " << rzad(24, 36) << endl;
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5528KB
stdin
Standard input is empty
stdout
18 12