Underline the correct word. 1 After working on the computer for over an hour I had to stop to draw/keep breath. 2 I couldn't sleep because of the terrible
1) var s:string;i,k:integer; begin read(s); for i:=1 to length(s) do if s[i]='*' then k:=k+1; writeln(k); end.
2) var s:string;i:integer; begin read(s); for i:=1 to length(s) do if s[i]='*' then begin delete(s,i,1);insert('0',s,i);end; writeln(s); end.
3) var s,s1:string;i:integer; begin read(s); for i:=length(s) downto 1 do s1:=s1+s[i]; writeln(s1); end.
4) var s:string;i,p1,p2:integer; begin read(s); for i:=1 to length(s) do begin if s[i]='(' then p1:=i; if s[i]=')' then p2:=i-p1; end; delete(s,p1,p2); writeln(s); end.
var s:string;i,k:integer;
begin
read(s);
for i:=1 to length(s) do
if s[i]='*' then k:=k+1;
writeln(k);
end.
2)
var s:string;i:integer;
begin
read(s);
for i:=1 to length(s) do
if s[i]='*' then begin delete(s,i,1);insert('0',s,i);end;
writeln(s);
end.
3)
var s,s1:string;i:integer;
begin
read(s);
for i:=length(s) downto 1 do
s1:=s1+s[i];
writeln(s1);
end.
4)
var s:string;i,p1,p2:integer;
begin
read(s);
for i:=1 to length(s) do begin
if s[i]='(' then p1:=i;
if s[i]=')' then p2:=i-p1;
end;
delete(s,p1,p2);
writeln(s);
end.