Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
16
Task/Least-common-multiple/Pascal/least-common-multiple.pas
Normal file
16
Task/Least-common-multiple/Pascal/least-common-multiple.pas
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
Program LeastCommonMultiple(output);
|
||||
|
||||
{$IFDEF FPC}
|
||||
{$MODE DELPHI}
|
||||
{$ENDIF}
|
||||
|
||||
function lcm(a, b: longint): longint;
|
||||
begin
|
||||
result := a;
|
||||
while (result mod b) <> 0 do
|
||||
inc(result, a);
|
||||
end;
|
||||
|
||||
begin
|
||||
writeln('The least common multiple of 12 and 18 is: ', lcm(12, 18));
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue