Guest User

Untitled

a guest
Dec 9th, 2019
88
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4.  
  5.  
  6. int NWD(int a,int b)
  7. {
  8. int k;
  9. while(b!=0)
  10. {
  11. k=b;
  12. b=a%b;
  13. a=k;
  14.  
  15. }
  16. return a;
  17.  
  18. }
  19. int main()
  20. {
  21. int a,b;
  22. cout<<"Podaj liczby: ";
  23. cin>>a>>b;
  24. cout<<"NWD("<<a<<","<<b<<") = "<<NWD(a,b)<<endl;
  25. system("pause");
  26. return 0;
  27. }
RAW Paste Data