Những câu hỏi liên quan
Tiên Tiên
Xem chi tiết
Nguyễn Lê Phước Thịnh
21 tháng 3 2021 lúc 22:22

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ình luận (0)
Nguyễn Lê Phước Thịnh
21 tháng 3 2021 lúc 22:26

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.

Bình luận (0)
Cao minh
Xem chi tiết
Triệu Ngọc Phượng
Xem chi tiết
Nguyễn Thị Ngọc Minh
Xem chi tiết
Nguyễn Lê Phước Thịnh
29 tháng 1 2021 lúc 22:18

uses crt;

var st:string;   

d,i,dem:integer;

begin

clrscr;

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

d:=length(st);

while st[1]=#32 do 

begin     

delete(st,1,1);     

d:=length(st); 

end;

while st[d]=#32 do 

begin     

delete(st,d,1);     

d:=length(st); 

end;

for i:=1 to d do 

begin     

while (st[i]=#32) and (st[i+1]=#32) do       

begin         

delete(st,i,1);         

d:=length(st);       

end; 

end;

st[1]:=upcase(st[1]);

for i:=1 to d do 

if st[i]=#32 then st[i+1]:=upcase(st[i+1]);

writeln('Ten cua ban sau khi viet dung la: ',st);

dem:=1;

for i:=1 to d do 

if st[i]=#32 then inc(dem);

writeln('So tu cua xau la: ',dem);

readln;

end.

Bình luận (0)
Ngưu Kim
Xem chi tiết
Phía sau một cô gái
20 tháng 3 2023 lúc 20:01

xau = input('Nhap chuoi: ')

so_khoang_cach = xau.count(' ')

print('So khoang cach:', so_khoang_cach)

vi_tri = []

for i in range(len(xau)):

     if xau[i] == ' ':

          vi_tri.append(i)

print('Vi tri khoang cach:', vi_tri)

Bình luận (0)
Khánh Mỹ
Xem chi tiết
Nguyễn Lê Phước Thịnh
3 tháng 3 2021 lúc 19:45

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 delete(st,i,1);

writeln('Xau moi la: ',st);

readln;

end.

Bình luận (0)
Trâm Phạm
Xem chi tiết
Minh Lệ
23 tháng 3 2023 lúc 6:03

Program HOC24;

var i,d: byte;

s: string;

begin

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

d:=0;

for i:=1 to length(s) do

if s[i]='b' then d:=d+1;

writeln('Co ',d,' ki tu b');

write('Xau moi sau khi da xoa la: ');

for i:=1 to length(s) do if s[i]<>'b' then write(s[i]);

readln

end.

Bình luận (0)
Lê Chiêu Nguyên	Vũ
Xem chi tiết
no no
Xem chi tiết
Minh Lệ
20 tháng 3 2022 lúc 18:54

Program HOC24;

var s: string;

begin

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

for i:=1 to length(s) do if s[i]<>#32 then write(s[i]);

readln

end.

Bình luận (0)