Advertisement
arturParchem

NWW/Dzielenie

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