Advertisement
JoannaDobrowolska

Zadanie 18

Mar 30th, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int NWW(int a, int b);
  5.  
  6. int main()
  7. {
  8. int a, b;
  9. cout << "Podaj dwie liczby: ";
  10. cin >>a>>b;
  11. cout << "NWW(" <<a<< "," <<b<< ") = " << (a*b)/NWW(a, b) << endl;
  12. return 0;
  13. }
  14.  
  15. int NWW(int a, int b)
  16. {
  17. if (b==0){
  18. return a;}
  19. NWW(b,a%b);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement