Const n = 3; type m = array[1..3, 1..3] of integer; var i, j: integer; f: text; a, b: m; s: string; begin assign(f, 'input.dat'); reset(f); writeln('считываемые данные'); for i : = 1 to n do begin for j : = 1 to n do begin read(f, a[i, j]); write(a[i, j]: 4) end; writeln end; writeln; for i : = 1 to n do begin for j : = 1 to n do begin read(f, b[i, j]); write(b[i, j]: 4) end; writeln end; close(f); rewrite(f); for i : = 1 to n do for j : = 1 to n do if j < > n + 1 - i then write(f, a[i, j], ' '); writeln(f); for i : = 1 to n do for j : = 1 to n do if j < > n + 1 - i then write(f, b[i, j], ' '); writeln(f); close(f); reset(f); writeln('данные, перезаписанные в файл'); while not eof(f) do begin readln(f,s); writeln(s) end; close(f); writeln end. тестовое решение: считываемые данные 2 3 7 4 3 1 8 9 6 14 3 12 5 -2 8 6 0 13 данные, перезаписанные в файл 2 3 4 1 9 6 14 3 5 8 0 13
Зинина-Олесия
18.01.2023
1. program a1; var s,m: integer; begin writeln('vvedi vozrast sashi : '); read(s); writeln('vvedi vozrast mashi : '); read(m); if s> m then writeln('sasha starshe mashi') else writeln('masha starshe sashi'); end.2.program a1; vars,m: integer; beginwriteln('vvedi vozrast sashi : '); read(s); writeln('vvedi vozrast mashi : '); read(m); if s=m then writeln('sasha i masha rovestniki') elseif s> m then writeln('sasha starshe mashi') else writeln('masha starshe sashi'); end.3.program a1; vara,b,c,d: real; beginreadln(a); readln(b); readln(c); if ((b< a) and (b< c)) then begin d: =a; a: =b; b: =d; end; if ((c< a) and (c< b)) then begin d: =a; a: =c; c: =d; end; if ((a> b) and (a< c)) then begin d: =b; b: =a; a: =d; end; if ((c< b) and (c> a)) then begin d: =b; b: =c; c: =d; end; if ((a> c) and (a> b)) then begin d: =c; c: =a; a: =d; end; if ((b> c) and (b> a)) then begin d: =c; c: =b; b: =d; end; writeln(a,'< ',b,'< ',c); end.