uses crt;
var s:string;
d,i:integer;
begin
clrscr;
write('Nhap xau S:'); readln(s);
d:=length(s);
writeln('Do dai cua xau la: ',d);
s:=upcase(s);
writeln('Xau S sau khi chuyen la: ',s);
for i:=1 to d do
if (s[i] in ['A'..'z']) or (s[i] in ['0'..'9']) then delete(s,i,1);
writeln('Xau S sau khi xoa cac ki tu la chu hoac so la: ',s);
for i:=1 to d do
if s[i]=' ' then delete(s,i,1);
writeln('Xau S sau khi xoa cac dau cach la: ',s);
readln;
end.