主题:菜鸟请高人赐教!感激不尽!
第十五届全国青少年信息学奥林匹克联赛初赛试题
[size=5][size=4][size=3][size=2]四、阅读程序写结果
2
var
a.b:array[0..3] of integer;
i,j,tmp:integer;
begin
for i:=0 to 3 do
read(b[i]);
for i:=0 to 3 do
begin
a[i]:=0;
for j:=0 to i do
begin
inc(a[i],b[j]);
inc(b[a[i] mod 4],a[j]);
end;
end;
tmp:=1;
for i:=0 to 3 do
begin
a[i]:=a[i] mod 10;
b[i]:=b[i] mod 10;
tmp:=tmp*(a[i]+b[i];
end;
writeln(tmp);
end.
输入:2 3 5 7
输出:
请高手解释越详细越好,非常感谢!!!
[size=5][size=4][size=3][size=2]四、阅读程序写结果
2
var
a.b:array[0..3] of integer;
i,j,tmp:integer;
begin
for i:=0 to 3 do
read(b[i]);
for i:=0 to 3 do
begin
a[i]:=0;
for j:=0 to i do
begin
inc(a[i],b[j]);
inc(b[a[i] mod 4],a[j]);
end;
end;
tmp:=1;
for i:=0 to 3 do
begin
a[i]:=a[i] mod 10;
b[i]:=b[i] mod 10;
tmp:=tmp*(a[i]+b[i];
end;
writeln(tmp);
end.
输入:2 3 5 7
输出:
请高手解释越详细越好,非常感谢!!!