Untitled
unknown
plain_text
a year ago
271 B
6
Indexable
#include <iostream> int LCM(int a, int b, int c) { int i = 2; while (true) { if (i % a == 0 && i % b == 0 && i % c == 0) { return i; } else i++; } } int main() { std::cout << "LCM: " << LCM(18, 20, 45); return 0; }
Editor is loading...
Leave a Comment