-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhow_much.pas
More file actions
34 lines (29 loc) · 765 Bytes
/
how_much.pas
File metadata and controls
34 lines (29 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
6 kyu
How Much?
https://www.codewars.com/kata/55b4d87a3766d9873a0000d4
}
program how_much;
{$mode objfpc}{$H+}
uses
how_much_unit;
procedure DoTest(m, n: int64; Expected: string);
var
Actual: string;
begin
Actual := Howmuch(m, n);
writeln('m : ', m);
writeln('n : ', n);
writeln('Expected: ', Expected);
writeln('Actual : ', Actual);
if Expected = Actual then
writeln('-> OK', LineEnding)
else
writeln('-> FAIL', LineEnding);
end;
begin
DoTest(1, 100, '[[M: 37 B: 5 C: 4][M: 100 B: 14 C: 11]]');
DoTest(0, 200, '[[M: 37 B: 5 C: 4][M: 100 B: 14 C: 11][M: 163 B: 23 C: 18]]');
DoTest(1100, 1000, '[[M: 1045 B: 149 C: 116]]');
DoTest(60246, 60201, '[[M: 60202 B: 8600 C: 6689]]');
end.