program Niz1;
uses wincrt;
const n=4;
var i : integer;
a,b,c : ARRAY [1..n] of
integer;
begin
WRITELN ('unesi elemente a i b, koji imaju po ',n,' elemenata ');
FOR i:=1 TO n DO
begin
gotoxy (5,i+2);
WRITE ('a',i,' '); READ(a[i]);
gotoxy (22,i+2);
WRITE ('b',i,' '); READ(b[i]);
end;
FOR i:=1 TO n DO
IF A[i] > B[i] THEN
C[i] := A[i] - B[i]
ELSE
C[i] := A[i] + B[i];
writeln;
WRITEln ('c ai-bi, za ai>bi INACE a+b');
writeln;
FOR i:=1 TO n DO
WRITEln ('c',i,' ',C[i]);
end.
|