K
Khách

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.

17 tháng 3 2023

xau = input("Nhập vào một xâu bất kì: ")

xau_moi = xau.replace("choi", "hoc")

print("Xâu mới sau khi thay thế là:", xau_moi)

17 tháng 3 2023

Program HOC24;

var s: string;

d: byte;

begin

write('Nhap xau : '); readln(s);

while pos('choi',s)<>0 do

begin

d:=pos('choi',s);

delete(s,d,4);

insert('hoc',s,d);

end;

write('Xau sau khi thay la: ',s);

readln

end.

3 tháng 3 2021

 Cậu tham khảo nhé!!!

https://hoc24.vn/cau-hoi/viet-chuong-trinh-nhap-mot-xau-tu-ban-phim-thay-ky-tu-39a39-thanh-39i39-va-in-xau-da-thay-ra-man-hinh-thay-tat-ca-chu-39anh39-t.257698320219

uses crt;

var s:string;

begin

clrscr;

write('Nhap xau: '); readln(s);

while pos('a',s)<>0 do

begin

insert('i',s,pos('a',s));

delete(s,pos('a',s),1);

end;

write('Xau sau khi chuyen la : ',s);

readln;

end.

10 tháng 5 2023

Var s,st:string;

i:integer;

Begin

Write('Nhap xau ');readln(s);

For i:=1 to length(s) do

If s[i] in ['0'..'9'] then st:=st+s[i];

Write('Cac ki tu so co trong day la ',st);

Readln

End.

10 tháng 5 2023

giúp em với ạ em cảm ơn nhìuu

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.

Bài 1:

uses crt;

var S:String;

vt:integer;

begin

clrscr;

Write(‘Nhap 1 xau:’); Readln(S);

While pos(‘nang’,s)>0 do

Begin

Vt:= pos(‘nang’,s);

Delete(s,vt,4);

Insert(‘mua’,s ,vt);

End;

Writeln(‘Xau sau khi thay the ’,s);

Readln;

End.

Bài 2: 

uses crt;

var st:string;

d,i,kt:integer;

begin

clrscr;

write('Nhap xau:'); readln(st);

d:=length(st);

kt:=0;

for i:=1 to d do 

  if st[i]<>st[d-i+1] then kt:=1;

if kt=0 then writeln(st,' la xau doi xung')

else writeln(st,' khong la xau doi xung');

readln;

end.