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. int main () {
  15. cout<<rzad(72, 90)<<" "<<rzad(24, 36)<<endl; // your code goes here
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5312KB
stdin
Standard input is empty
stdout
18  12