#1462: 这样不行吗? Pascal的


NMGBTJZ (Reborned Phoenix)

學校 : 不指定學校
編號 : 3077
來源 : [61.138.100.70]
最後登入時間 :
2009-03-16 17:11:28
a005. Eva 的回家作業 -- POJ | From: [61.138.100.70] | 發表日期 : 2009-03-02 17:22

program shulie;
var
 a:array[1..5]of integer;
 b,i,j,k:integer;
begin
 readln(b);
 for i:=1 to b do
  for j:=1 to 4 do
   begin
   read(a[j]);readln;
   if a[2]-a[1]-(a[4]-a[3])=0 then begin
                                a[5]:=a[4]+a[4]-a[3];
                                for k:=1 to 5 do write(a[k]);
                                writeln;
                               end
                          else begin
                                a[5]:=a[4]div a[3]*a[4];
                                for k:=1 to 5 do write(a[k]);
                                writeln;
   end;                        end;
 readln;
end. 
ZeroJudge Forum