Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- cout << "Podaj a i b" << endl;
- double a,b;
- cin >> a >>b;
- int i;
- if (a!=0 && b!=0)
- {
- if (a>b)
- {
- for (i = 1; a!=b; i++)
- a=a-b;
- }
- else
- if (b>a)
- {
- for (i=1; b!=a; i++)
- b=b-a;
- }
- cout << i;
- }
- else
- {
- cout << "Nie dziel przez zero!";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement