#include <iostream>
#define _ std::
int NOD(int a, int b){
return (a == 0) ? b : NOD(b%a, a);
}
int NOK(int a, int b) {
return (a*b) / NOD(a, b);
int main() {
int a, b, c, d;
_ cin >> a >> b >> c >> d;
_ cout << NOK(a, NOK(b, NOK(c, d))) << _ endl;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
#define _ std::
int NOD(int a, int b){
return (a == 0) ? b : NOD(b%a, a);
}
int NOK(int a, int b) {
return (a*b) / NOD(a, b);
}
int main() {
int a, b, c, d;
_ cin >> a >> b >> c >> d;
_ cout << NOK(a, NOK(b, NOK(c, d))) << _ endl;
}