type
base = record
id: integer;
ball: integer;
end;
var
t: text;
a: array of array of integer;
n: integer;
st, tmp: string;
err: integer := 1;
database: base;
begin
readln(n);
setlength(a, n);
for i: integer := low(a) to high(a) do
setlength(a[i], 2);
for i: integer := low(a) to high(a) do
begin
readln(st);
tmp := st;
delete(tmp, pos(' ', tmp, err), tmp.Length - pos(' ', tmp, err) + 1);
database.id := strtoint(tmp);
tmp := st;
delete(tmp, 1, pos(' ', tmp, err));
database.ball := strtoint(tmp);
a[i, 0] := database.id;
a[i, 1] := database.ball;
end;
var j: integer := 0;
assign(t, 'output.txt');
rewrite(t);
while (j <= high(a)) do
begin
if (j + 1 < high(a)) and (a[j, 1] = a[j + 1, 1]) then
if (a[j, 0] < a[j + 1, 0]) then begin
write(t, inttostr(a[j, 0])); write(t, ' '); write(t, inttostr(a[j, 1])); writeln(t,'');
write(t, inttostr(a[j + 1, 0])); write(t, ' '); write(t, inttostr(a[j + 1, 1])); writeln(t,'');
end else begin
write(t, inttostr(a[j + 1, 0])); write(t, ' '); write(t, inttostr(a[j + 1, 1])); writeln(t,'');
write(t, inttostr(a[j, 0])); write(t, ' '); write(t, inttostr(a[j, 1])); writeln(t,'');
end;
if (j+1=n) then
write(t, inttostr(a[j, 0])); write(t, ' '); write(t, inttostr(a[j, 1])); writeln(t,'');
inc(j, 2);
end;
close(t);
end.
Поделитесь своими знаниями, ответьте на вопрос:
6. Открой секрет Черного ящикавход май save 123 принтер ми12лдвыход мй sv питр Это должно быть в виде таблицы Где принтер там с низу питр написано.
1)
var a,b,x,y:longint;
begin
write("Vvedite nachalo i konec otrezka: ");
read(a,b);
write("Vvedite x: ");
read(x);
y:=sqr(x)*x;
if (y>a)and(y<b) then write("Na dannom otrezke znachenie funkcii ravno ",y) else write("Na dannom otrezke net reshenii");
readln
end.
2)
var c,i:byte;
begin
for i:=49 to 215 do
if (i mod 4=0) then c:=c+1;
write("Kolichestvo chisel, kratnyh 4 na zadannom promezhutke ravno ",c);
readln
end.
3)
var i:integer;
p:longint;
for i:=1000 to 9999 do
if (i mod 10=3) then p:=p*i;
write("Proizvedenie chetyrehznachnyh chisel, okanchivaushihsya na 3 ravno ",p);
readln
end.
4)
var i:byte;
c:integer;
begin
for i:=221 to 778 do
if ((i mod 10)=(i div 100)) then c:=c+1;
write("Kolichestvo chisel ravno ",c);
readln
end.
5)
var i:longint;
c:integer;
begin
for i:=10000 to 99999 do
if ((i mod 10)=(i div 10000))and(((i mod 100)div 10)=((i div 1000)mod 10)) then c:=c+1;
write("Kolichestvo chisel ravno ",c);
readln
end.