Program n1; Uses CRT; Const n=20; Var m: array[1..n] of integer; i,a,s,b: integer; begin ClrScr; Randomize; For i:=1 to n do begin m[i]:=random(50); write(m[i]:3); end; writeln; writeln('Введите A и B'); readln(a,b); For i:=a to b do s:=s+m[i]; writeln('Сумма равна ',s); readln end.
Program pr; uses crt; Var a, x1, x2, x3, x4:integer; Begin Writeln('введите 4-х значное число'); readln(a); x1:=a div 1000; x2:=(a mod 1000) div 100; x3:=(a mod 100) div 10; x4:=a mod 10; Writeln(x1); Writeln(x2); Writeln(x3); Writeln(x4); readln; end.