Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- int a, b, c;
- cout << "Pierwsza liczba: ";
- cin >> a;
- cout << "Druga liczba: ";
- cin >> b;
- c = a*b;
- if(a==b) cout<< "Dana liczba jest Najmnieszja wspolna wielokrotnoscia\n";
- else{
- do
- {
- if(a>b) a=a-b;
- else b=b-a;
- }
- while(a!=b);
- cout << "Najmniejsza wspolna wielokrotnosc: " << c/a << endl;
- }
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement