[r]
Trang 1Program day_con_co_tong_bang_so_nhap;
uses crt;
var s,n,i,j,k:longint;
a:array[1 1000]of longint;
begin
clrscr;
write('Nhap N=');readln(n);
for i:=1 to n do
begin
write('Nhap a[',i,']=');readln(a[i]);
begin
write('Nhap tong S=');readln(s);
for i:=1 to n do
for j:=i+1 to n do
if (a[i]+a[j]=s) then
begin
if k=0 then writeln('Day con la:');
writeln(a[i]:6,' ;',a[j]:3);
k:=1;
end;
if k=0 then writeln('Khong tim thay day thoa man');
readln
end