Pascal 帕斯卡重复标识符 程序Noname4; 功能分钟数(Amin,Bmin:integer):整数; 函数时间(Aval,Bval:integer):整数; 开始 如果(0
改变:Pascal 帕斯卡重复标识符 程序Noname4; 功能分钟数(Amin,Bmin:integer):整数; 函数时间(Aval,Bval:integer):整数; 开始 如果(0,pascal,Pascal,改变: program Noname4; function minutes (Amin, Bmin :integer) : integer; function time (Aval, Bval :integer) : integer; begin if (0 <= Aval) and (Bval < 24) then time :=Bval - Aval; if (0 <= Amin) and (Bmin < 60) then minutes :
program Noname4;
function minutes (Amin, Bmin :integer) : integer;
function time (Aval, Bval :integer) : integer;
begin
if (0 <= Aval) and (Bval < 24) then
time :=Bval - Aval;
if (0 <= Amin) and (Bmin < 60) then
minutes :=Bmin - Amin;
end;
var Aval, Bval, n , x , i , y :integer;
duom, rez : text;
begin
assign(duom, 'Duomenys2.txt');
Reset(duom);
Readln(duom, n );
assign(rez, 'Rezultatai2.txt');
rewrite(rez);
for i := 1 to n do
begin
Readln(duom, Aval, Bval, Amin, Bmin);
x := time(Aval, Bval);
y := minutes(Amin, Bmin);
writeln(rez, x);
writeln(rez, y);
end;
close(duom);
close(rez);
end;
begin
end.
致:
它们已经被定义为传递到分钟函数中的变量您的
Amin
和Bmin
变量已经是minutes
函数的参数。
program Noname4;
function minutes (Amin, Bmin :integer) : integer;
function time (Aval, Bval :integer) : integer;
begin
if (0 <= Aval) and (Bval < 24) then
time :=Bval - Aval;
if (0 <= Amin) and (Bmin < 60) then
minutes :=Bmin - Amin;
end;
var Aval, Bval, n , x , i , y :integer;
duom, rez : text;
begin
assign(duom, 'Duomenys2.txt');
Reset(duom);
Readln(duom, n );
assign(rez, 'Rezultatai2.txt');
rewrite(rez);
for i := 1 to n do
begin
Readln(duom, Aval, Bval, Amin, Bmin);
x := time(Aval, Bval);
y := minutes(Amin, Bmin);
writeln(rez, x);
writeln(rez, y);
end;
close(duom);
close(rez);
end;
begin
end.
var Aval, Amin, Bval, Bmin, n , x , i , y :integer;
duom, rez : text;
var Aval, Bval, n , x , i , y :integer;
duom, rez : text;