?>
, очень нужна ! 1) Що відбудеться після виконання фрагмента програми: kil:=0; For i:=1 to 5 do if A[i]>0 then kil:=kil+1; 2) Приведена процедура впорядкування елементів масиву за зростанням, але один з фрагментів треба вписати самостійно: procedure TForm1.Button1Click(Sender: TObject); var a: array [1..9] of real; p:real; n, i, j: integer; begin n:=9; for i:=1 to n do a[i]:=StrToFloat(Memo1.Lines[i-1]); for j:=1 to n-1 do for i:=1 to n-j do …………………………………………………………………………… ……………………………………………………………………………. Memo2.Clear; for i := 1 to n do Memo2.Lines.Append(FloatToStr(a[i])); end;
Ответы
program s1;
uses
SysUtils;
var
s, t: string;
i: Integer;
c: string;
begin
Write ('Введите строку: ');
ReadLn (s);
t := '';
for i := 1 to Length (s) do begin
if s [i] in ['a'..'z'] then
c := IntToStr (Ord (s [i]) - Ord ('a') + 1)
else if s [i] in ['A'..'Z'] then
c := IntToStr (Ord (s [i]) - Ord ('A') + 1)
else if s [i] = ' ' then
c := '0'
else
c := s [i];
t := t + c + ' ';
end;
WriteLn (t);
ReadLn
end.
program s2;
uses
SysUtils;
var
s, t: string;
i: Integer;
c: string;
begin
Write ('Введите строку: ');
ReadLn (s);
t := '';
for i := 1 to Length (s) do begin
if not (s [i] in ['e', 'y', 'u', 'i', 'o', 'a', 'E', 'Y', 'U', 'I', 'O', 'A']) then
c := s [i]
else
c := '';
t := t + c;
end;
WriteLn (t);
ReadLn
end.