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. int rzad(int goscie, int gospodarze) {
  13. return nwd(goscie, gospodarze);
  14. }
  15. int main() {
  16. cout<<rzad(72, 90)<<" "<<rzad(24, 36)<<endl;
  17. return 0;
  18. }
  19.  
  20.  
  21.  
  22.  
  23.  
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
18 12