You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
789 B
Plaintext

6 years ago
{ Julius Riegel, 20.12.18 }
program programm2;
uses
utils in './lib/utils.pas';
6 years ago
const
fname = './persons/Name';
6 years ago
6 years ago
function reading_file_int(fnum: integer): integer;
6 years ago
var
6 years ago
curr_fname: string;
6 years ago
temp_entry: person;
begin
curr_fname := fname + int_to_str(fnum) + '.prs';
temp_entry := read_file(curr_fname);
6 years ago
graphictext(10, 20 * fnum, 80, 'file' + int_to_str(fnum) + ': ' + curr_fname);
reading_file_int := temp_entry.number;
6 years ago
end;
var
6 years ago
i: integer;
numsum, num: integer;
nums: array [0..3] of integer;
6 years ago
begin
WriteLn;
numsum := 0;
init_graphics();
for i := 1 to 4 do
begin
num := reading_file_int(i);
6 years ago
nums[i - 1] := num;
6 years ago
numsum := numsum + num;
end;
6 years ago
graphictext(10, 100, 80, ('sum: ' + int_to_str(numsum)));
6 years ago
drawrectnums(nums, 80);
ReadLn;
end.