我编写了一个程序,将有关工人的不同数据填充到表中。(姓名、姓氏和薪水)
帮我写一个程序或函数来查找最高工资值和这个工人的名字,然后写在控制台
我可以使用循环来制作它吗?
program labasix;
type firma = record
name : string;
lastName : string;
salary : integer;
end;
var
svitoch : array[1..12] of firma;
i : integer;
countOfWorkers : integer;
begin
write('Number of workers (not more than 12): ');
readln(countOfWorkers);
writeln();
for i := 1 to countOfWorkers do
begin
write('Name: '); readln( svitoch[i].name );
write('lastName: '); readln( svitoch[i].lastName );
write('Salary: '); readln( svitoch[i].salary );
writeln();
end;
for i := 1 to countOfWorkers do
begin
{ what code must be here ??? }
end;
end.
一定有这样的东西
procedure findMax(x, y, z: integer; var m: integer);
begin
if x > y then
m:= x
else
m:= y;
if z > m then
m:= z;
end;
但是如何获得 xyz 值?
太感谢了 !