Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
câu 1 Uses Crt;
Var St:String;
dem: Array[‘A’..’Z’] Of Byte
; i:Byte;
ch:Char;
Begin Write(‘Nhap xau St: ‘);
Readln(St);
{Khởi tạo mảng} For ch:=’A’ To ‘Z’ Do dem[ch]:=0;
{Duyệt xâu} For i:=1 To Length(St) Do If Upcase(St[i]) IN [‘A’..’Z’] Then Inc(dem[Upcase(St[i])]);
{Liệt kê các ký tự ra màn hình} For ch:=’A’ To ‘Z’ Do If dem[ch]>0 Then Writeln(ch,’ : ’,dem[ch]);
Readln;
Program HOC24;
var s: string;
i,d: byte;
begin
write('Nhap xau :'); readln(s);
d:=0;
for i:=1 to length(s) do if s[i]=' ' then d:=d+1;
write('Xau ',s,' co ',d,' ki tu cach');
readln
end.
uses crt;
var s:string;
i,d,dem:integer;
begin
clrscr;
write('Nhap xau:); readln(s);
d:=length(s);
dem:=0;
for i:=1 to d do
if s[i]=#32 then inc(dem);
writeln(dem);
readln;
end.
2:
uses crt;
var st:string;
d,i,dem1,dem2:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
dem1:=0;
dem2:=0;
for i:=1 to d do
begin
if st[i] in ['0'..'9'] then inc(dem1);
if (st[i] in ['a'..'z']) or (st[i] in ['A'..'Z']) then inc(dem2);
end;
writeln('So ki tu la chu so la: ',dem1);
writeln('So ki tu la chu cai la: ',dem2);
for i:=1 to d do
if st[i] in ['0'..'9'] then delete(st,i,1);
writeln('Xau sau khi xoa cac chu so la: ',st);
readln;
end.
uses crt;
var s:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(s);
d:=length(s);
for i:=1 to d do
s[i]:=upcase(s[i]);
writeln(s);
readln;
end.
Var a: string;
i, Dem: integer;
Begin
writeln(‘nhap xau:’);
Readln(a);
Dem:=0;
For i:=1 to length(a) do
If (‘A’<=a[i]) and (a[i]<=’Z’) then
Dem:= Dem+1;
Writeln(Dem);
Readln
End.
uses crt;
var st:string;
i,d,dem,dem1:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
dem:=0;
dem1:=0;
for i:=1 to d do
begin
if (st[i] in ['a'..'z']) or (st[i] in ['A'..'Z']) then inc(dem);
if st[i] in ['0'..'9'] then inc(dem1);
end;
writeln('So chu cai trong xau la: ',dem);
writeln('So chu so trong xau la: ',dem1);
for i:=1 to d do
st[i]:=upcase(st[i]);
writeln('Xau sau khi in hoa la: ',st);
readln;
end.