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;
uses crt;
var s:string;
i,d,dem1,dem2,dem3,dem4:integer;
begin
clrscr;
write('Nhap xau s:'); readln(s);
d:=length(s);
dem1:=0;
dem2:=0;
dem3:=0;
dem4:=0;
for i:=1 to d do
begin
if st[i] in ['0'..'9'] then inc(dem1)
else if st[i] in ['a'..'z'] then inc(dem2)
else if st[i] in ['A'..'Z'] then inc(dem3)
else inc(dem4);
end;
writeln('So luong ky tu so la: ',dem1);
writeln('So luong ky tu thuong la: ',dem2);
writeln('So luong ky tu hoa la: ',dem3);
writeln('So luong ky tu dac biet la: ',dem4);
readln;
end.
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.
var a,b:string;
begin
write('a = '); readln(a);
write('b = '); readln(b);
if a[2] = b[length(b)-1] then write('Có trùng') else write('Không trùng');
readln
end.
Program HOC24;
var s: string;
tg,d,max,i: byte;
code: integer;
begin
write('Nhap xau : '); readln(s);
// cau a
for i:=1 to length(s) do if s[i] in ['a'..'z'] then write(upcase(s[i]));
//------
writeln;
//-cau b
for i:=length(s) downto 1 do if s[i] in ['0'..'9'] then write(s[i]);
//------
writeln;
//---cau c
d:=0;
for i:= 1 to length(s) do
if s[i] in ['0'..'9'] then
begin
val(s[i],tg,code);
if tg>max then max:=tg;
d:=d+1;
end;
if d=0 then write('Khong co chu so trong day') else write('Chu so lon nhat la : ',max);
readln
end.
uses crt;
var st,st1:string;
d,i,d1,max,x,y:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
writeln('Day cac ki tu thuong doi sang chu hoa la: ');
for i:=1 to d do
if st[i] in ['a'..'z'] then write(upcase(st[i]):4);
st1:='';
for i:=1 to d do
if st[i] in ['0'..'9'] then st1:=st1+st[i];
d1:=length(st1);
for i:=d1 downto 1 do
write(st1[i]:4);
writeln;
max:=0;
for i:=1 to d1 do
begin
val(st1[i],x,y);
if max<x then max:=x;
end;
writeln('Chu so lon nhat trong xau la: ',max);
readln;
end.
uses crt;
var st:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
writeln('Xau vua nhap la: ',st);
for i:=1 to d do
if st[i] in ['a'..'z'] then upcase(st[i]);
writeln(st);
readln;
end.