Var St: string; z:string[10]; x:string[2]; i,j,k,m: integer; //новые переменные Begin Write('введите строку текста - St'); Readln(St); k:=0; //обнуляем на всякий случай z:='0123456789'; i:=1; for j:=1 to length(St) do //начало begin; for m:=1 to 10 do if St[j]=z[m] then inc(k); end; if k=0 then begin; writeln('в тексте нет цифр'); exit; end; //конец while i<=length(st)-1 do begin x:=copy(st,I,2); if (x[1]=x[2]) and (pos(x[1],z)<>0) then begin delete(st,i,2); insert('две',st,i); i:=i+1; end; i:=i+1; end; writeln('преобразованная строка ', st); End.
PascalABC.NET 3.3
program journal;
var
sum, mark, count, n: integer;
check: boolean;
begin
sum := 0;
check := true;
count := 0;
writeln('Введите количество оценок: ');
readln(n);
if (n > 0) then begin
while (count <> n) do
begin
readln(mark);
inc(sum, mark);
if (mark < 4 ) then check := false;
inc(count);
if (count = n) then writeln('Ввод окончен!');
end;
end else writeln('Error!');
if ((check) and (sum > 0) and (n > 0)) then writeln('Ты молодец!');
end.