Advertisement
arturParchem

Nww/Odejmowanie

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