Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "iostream"
- #include "conio.h"
- using namespace std;
- int ucln(int a, int b)
- {
- while (a != b)
- {
- if (a < b)
- b = b - a;
- else
- a = a - b;
- }
- return b;
- }
- void main()
- {
- int a,b;
- cin >> a; cin >> b;
- cout << "UCLN la: " << ucln(a,b) << endl;
- cout << "BCLN la: " << (a*b)/ucln(a,b) << endl;
- _getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement