B1: bạn ghi rõ đề bài đi... vì không phải ai cũng học 11 và không phải ai cũng mang theo cuốn Tin học 11 bên mình...
B2:
Code:
Var xh:array['A'..'Z'] of byte;
s:string;
i:byte;
c:char;
Begin
write('Nhap xau');readln(s);
For c:='A' to 'Z' do xh[c]:=0;
For i:=1 to length(s) do
s[i]:=upcase(s[i]);
For i:=1 to length(s) do xh[s[i]]:=xh[s[i]]+1;
For c:='A' to 'Z' do
If xh[c]<>0 then writeln(c,' xuat hien ',xh[c],' lan);
Readln;
End.
[=========> Bổ sung bài viết <=========]
B3:
var s:string;
i:byte;
Begin
write('Nhap xau');readln(s);
i:=pos('anh',s);
while i<>0 do
begin
delete(s,i,3);
insert(s,i,'em');
i:=pos('anh',s);
end;
writeln('Xau nhan duoc: ',s);
Readln;
End.
Bookmarks