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.
uses crt;
var st:string;
i,d,dem:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
dem:=0;
for i:=1 to d do
if (st[i] in ['a'..'z']) or (st[i] in ['A'..'Z']) then inc(dem);
writeln(dem);
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.
Var a: string;
i, Dem: integer;
Begin
writeln(‘nhap xau:’);
Readln(a);
Dem:=0;
For i:=1 to length(a) do
If a[i] =’ ‘ then
Dem:= Dem+1;
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.
Program HOC24;
var i,d1,d2: byte;
st1,st2: string[60];
begin
write('Nhap xau st1: '); readln(st1);
//---------------Câu 1-------------------
d1:=0; d2:=0;
for i:=1 to length(st1) do
begin
if st1[i]='A' then d1:=d1+1;
if st1[i]='a' then d2:=d2+1;
end;
writeln('Co ',d1,' ki tu A trong xau');
writeln('Co ',d2,' ki tu a trong xau');
//---------------------- Câu 2 --------------------
st2:='';
for i:=1 to length(st1) do if st1[i] in ['a'..'z'] then st2:=st2+st1[i];
writeln('Xau st2 la: ',st2);
//------------------------------Câu 3--------------------
for i:=1 to length(st1) do st1[i]:=upcase(st1[i]);
write('Xau st1 sau khi in hoa la: ',st1);
//--------------------------------------------------------
readln
end.
uses crt;
var a,b:string;
i,d:integer;
begin
clrscr;
write('Nhap xau a:'); readln(a);
d:=length(a);
b:='';
for i:=1 to d do
if a[i] in ['A'..'Z'] then b:=b+a[i];
writeln(b);
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’)
Dem:= Dem+1;
Writeln(Dem);
Readln
End.