Pascal: var a: array [1..10] of integer; i: integer; begin for i: =1 to n do begin write ('a[',i,'] = '); readln (a[i]); end; for i: =1 to 10 do if a[i] mod 2 = 1 then write (a[i],' '); end. c++: #include < iostream> using namespace std; int main() { int a[10]; for (int i = 0; i< 10; i++) { cout < < "a[" < < i < < "] = '"; cin > > a[i]; } for (int i = 0; i< 10; i++) if (a[i]%2==1) cout < < a[i] < < " "; return 0; }
avetisov-84850
12.11.2022
Const n = 5; m = 8; var a: array [1..n,1..8] of char; b: array [1..5] of char; i,j,k,l,s,c,cnt: integer; tmp: char; begin randomize; for i: =1 to n do begin for j: =1 to m do begin a[i,j]: =chr(random(9)+65); k: =random(2); if (k=1) then a[i,j]: =chr(ord(a[i,j])-16); write (a[i,j]: 3); end; writeln; end; cnt: =0; for i: =1 to m do begin l: =0; s: =0; inc(cnt); for c: =1 to m do if (ord(a[cnt,c])> =49) and (ord(a[cnt,c])< =57) then s: =s+(ord(a[cnt,c])-48); for j: =1 to n do begin if (ord(a[j,i])> =65) and (ord(a[j,i])< =73) then begin inc(l); b[l]: =a[j,i]; end; end; for c: =1 to l-1 do if b[c+1]> b[c] then begin tmp: =b[c]; b[c]: =b[c+1]; b[c+1]: =tmp; end; for c: =1 to l do write (b[c],' '); writeln ('summa: ',s); end; end.