Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- //Zad18
- using namespace std;
- //Zad18
- int a , b;
- void NWW()
- {
- for(int i=1; i<=10000; i++)
- {
- if(i%a==0 && i%b==0)
- {
- cout<<i;
- break;
- }
- }
- }
- int main()
- {
- cout << "Podaj 2 liczby naturalne" << endl;
- cin >> a >> b;
- if(a<0 || b<0)
- {
- cout<<"To nie jest liczba naturalna"<<endl;
- }
- cout<<"Ich najmniejsza wspolna wielokrotnosc to: ";
- NWW();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment