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