📄 ac1269.pas
字号:
program tju1269;
const
maxn=10000;
var
a:array[1..maxn]of byte;
n,i,b,s1,s2,t:longint;
first:boolean;
begin
first:=true;
repeat
read(n);if n=0 then halt;
for i:=1 to n do read(a[i]);
s1:=0;s2:=0;
for i:=1 to n do begin
read(b);
if abs(a[i]-b)>1 then
if a[i]>b then inc(s1,a[i]) else inc(s2,b)
else if abs(a[i]-b)=1 then begin
t:=a[i]+b;if t=3 then t:=6;
if a[i]<b then inc(s1,t) else inc(s2,t);
end;
end;
if first then first:=false else writeln;
writeln(s1,' ',s2);
until false;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -