program ElectionWinner;
uses crt;
function find_winner(candidates: array of string; votes: array of integer): string;
var
max_votes, i: integer;
winner: string;
begin
max_votes := -1;
winner := '';
for i := 0 to High(candidates) do
begin
if votes[i] > max_votes then
begin
max_votes := votes[i];
winner := candidates[i];
end;
end;
find_winner := winner;
end;
var
candidates: array[0..3] of string = ('Alice', 'Bob', 'Charlie', 'Diana');
votes: array[0..3] of integer = (1500, 2300, 2300, 2000);
winner: string;
begin
winner := find_winner(candidates, votes);
writeln('The winning candidate is: ', winner);
readln;
end. V