giúp mình với ạ
Đề: Dùng thủ tục để thay xâu X1 = xâu X2 trong xâu S. Cho S, X1,X2 nhập từ bàn phím.
Cảm ơn ạ
Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
uses crt;
var s:string;
i,d,dem:integer;
begin
clrscr;
write('Nhap xau S:'); readln(s);
d:=length(s);
writeln('Cac ki tu so co trong xau S:');
dem:=0;
for i:=1 to d do
if s[i] in ['0'..'9'] then
begin
write(s[i]:4);
inc(dem);
end;
writeln;
writeln('So ki tu chu so co trong xau S: ',dem);
for i:=1 to d do
if s[i] in ['0'..'9'] then s[i]:='A';
writeln('Xau sau khi doi la: ',s);
readln;
end.
uses crt;
var st:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
writeln('Xau vua nhap la: ',st);
for i:=1 to d do
if st[i]=#32 then st[i]:='_';
writeln('Xau thay the la: ',st);
readln;
end.
uses crt;
var x:string;
begin
clrscr;
write('x='); readln(x);
writeln(length(x));
readln;
end.