Những câu hỏi liên quan
Võ Thị Mai Sương
Xem chi tiết
Nguyễn An
Xem chi tiết
Nguyễn Lê Phước Thịnh
10 tháng 7 2021 lúc 14:32

uses crt;

var s,s1,s2:string;

i,d:integer;

begin

clrscr;

readln(s);

s1:=''

s2:=''

d:=length(s);

for i:=1 to d do

  begin

if s[i] in ['0'..'9'] then s1:=s1+s[i];

if (s[i] in ['a'..'z']) or (s[i] in ['A'..'Z']) then s2:=s2+s[i];

end;

writeln('Xau chua cac ki tu so la: ',s1);

writeln('Xau chua cac ki tu chu la: ',s2);

readln;

end.

Bình luận (0)
APOK FF
Xem chi tiết
Asuna
Xem chi tiết
Văn Hữu
Xem chi tiết
Nguyễn Quốc Đạt
19 tháng 12 2023 lúc 19:54

Program HOC24;

var s: string;

i,x: byte;

begin

readln(s);

//-----------Câu a

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

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

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

writeln(s);

//-------------Câu b

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

for i:=1 to length(s) do

if s[i]=#32 upcase(s[i+1]);

writeln(s);

//--------------Câu c

for i:=1 to length(s) do

if s[i]=#32 then x:=i;

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

write(s[i]);

//---------------------------

readln

end.

Bình luận (0)
APOK FF
Xem chi tiết
U Lan
Xem chi tiết
U Lan
Xem chi tiết
U Lan
Xem chi tiết