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)
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)
Linh Tran
Xem chi tiết
Nguyễn Lê Phước Thịnh
31 tháng 3 2021 lúc 18:37

uses crt;

var st:string;

begin

clrscr;

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

delete(st,3,4);

writeln('Xau sau khi xoa la: ',st);

readln;

end.

Bình luận (0)
Bùi Anh Tuấn
31 tháng 3 2021 lúc 19:53

Bình luận (0)
feng
Xem chi tiết
nguyễn an phát
24 tháng 5 2022 lúc 10:59

program bai1;
uses crt;
var i:integer;
s,s1:string;
begin
  clrscr;
  write('nhap S:');readln(s);
  while pos('C',s)<>0 do
  begin
    insert('LOP11A',s,pos('C',s));
    delete(s,pos('C',s),1);
  end;
  writeln('xau sau khi bien doi la: ',s);
  writeln('do dai cua xau tren la: ',length(s));
  write('nhap s1:');readln(s1);
  if s1[1]=s[1] then writeln('ki tu dau cua hai xau trung nhau')
  else writeln('ki tu dau cua hai xau khong trung nhau');
  readln;
end.

Bình luận (0)
Nguyễn Thảo Vy
Xem chi tiết
Hiếu
Xem chi tiết
Nguyễn Lê Phước Thịnh
29 tháng 3 2021 lúc 21:36

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.

Bình luận (0)
Lê Thị Vân Giang
Xem chi tiết
Thangg PH
Xem chi tiết
Minh Lệ
3 tháng 4 2021 lúc 18:54

Program HOC24;

var S: string;

d,i: byte;

begin

write('S= '); readln(s);

For i:= length(s) downto 1 do write(s[i]);

writeln;

while s[length(s)]=#32 do delete(s,length(s),1);

while pos(#32#32,s)<>0 do delete(s,pos(#32#32,s),1);

while s[1]=#32 do delete(s,1,1);

d:=0;

for i:=1 to length(s) do d:=d+1;

write('So tu :',d);

readln

end.

Bình luận (1)
Nguyễn Lê Phước Thịnh
3 tháng 4 2021 lúc 19:16

uses crt;

var s:string[200];

i,d,dem:integer;

begin

clrscr;

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

d:=length(s);

write('Xau viet theo chieu nguoc la: ');

for i:=d downto 1 do 

  write(st[i]);

writeln;

dem:=0;

for i:=1 to d do 

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

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

readln;

end.

Bình luận (1)
Huyên Lê Thị Mỹ
Xem chi tiết
Kiều Vũ Linh
10 tháng 5 2023 lúc 21:03

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.

Bình luận (0)
Huyên Lê Thị Mỹ
10 tháng 5 2023 lúc 20:29

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

Bình luận (0)