Câu 1:
uses crt;
var xau: string;
n,i:integer;
begin
clrscr;
n:= 0;
write('Nhap xau: ');readln(xau);
for i:= 1 to length(xau) do
if xau[i] = chr(32) then n:= n + 1;
write('So ki tu la phim cach trong xau la: ', n);
readln
end.
Câu 2:
uses crt;
var xau: string;
n,i:integer;
begin
clrscr;
n:= 0;
write('Nhap xau: ');readln(xau);
for i:= 1 to length(xau) do
if xau[i] = upcase(xau[i]) then n:= n + 1;
write('So ki tu in hoa trong xau la: ', n);
readln
end.