K
Khách

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.

8 tháng 5 2019

uses crt;
var ch,d:char;
    i,max:integer;
    s:string;
    a:array['A'..'Z']of integer;
begin
write('nhap xau:');readln(s);
for ch:='A'to'Z' do a[ch]:=0;
for i:=1 to length(s) do begin
s[i]:=upcase(s[i]);
a[s[i]]:=a[s[i]]+1;
end;
max:=a['A'];
for ch:='A'to'Z' do
if a[ch]>max then begin
max:=a[ch];
d:=ch;
end;
writeln('ki tu ',d,' xuat hien nhieu nhat:',max);
readln
end.

8 tháng 5 2019

program xoa_ky_tu;
uses crt;
var x,y:string;
    i,j,dem,max: integer;
    a:char;
BEGIN
clrscr;
write('nhap xau x : ');
readln(x);
y:=x;

for i:=1 to length(x) do
begin
j:=i+1;
repeat
if x[i]=x[j] then delete(x,j,1)
else
j:=j+1;
until (j>length(x));
end;
writeln('xau sau khi loai bo ki tu giong nhau la :',x);

max:=0;
a:=' ';
for i:=1 to length(x) do
begin
dem:=0;
for j:=1 to length(y) do
if x[i]=y[j] then
dem:=dem+1;
if dem>max then
begin
max:=dem;

a:=x[i];
end;
end;
writeln('ki tu ',a,' xuat hien ',max,' lan');

readln;
end.

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.

1 tháng 9 2021

Program HOC24;

var s: string;

i: byte;

begin

write('Nhap xau: '); readln(s);

for i:=1 to n do if not(s[i] in ['0'..'9']) then write(s[i]);

readln

end.

uses crt;

var st,s:string;

    i,d,dem,kt,j,dem1:integer;

begin

clrscr;

write('Nhap xau:'); readln(s);

writeln('Xau vua nhap la: ',s);

d:=length(s);

for i:=1 to d do

  if s[i]=#32 then delete(s,i,1);

dem:=1;

st[1]:=s[1];

for i:=1 to d do

  begin

     kt:=0;

     for j:=1 to dem do

       if s[i]=st[j] then kt:=1;

     if kt=0 then

        begin

           inc(dem);

           st[dem]:=s[i];

        end;

  end;

for i:=1 to dem do

  begin

     dem1:=0;

     for j:=1 to d do

       if st[i]=s[j] then inc(dem1);

     writeln(st[i],' xuat hien ',dem1,' lan');

  end;

readln;

end.

18 tháng 1 2021

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 s:string;

i,d:integer;

begin

clrscr;

write('Nhap xau S:'); readln(s);

d:=length(s);

for i:=1 to d do 

  s[i]:=upcase(s[i]);

writeln(s);

readln;

end.

3 tháng 3 2021

Use crt;

Var S : String;

P: longint;

Begin

Write('Nhap s: '); readln (S);

For P:=length(S) downto 1 do

Write(P);

Readln;

End.

uses crt;

var st:string;

i,d:integer;

begin

clrscr;

write('Nhap xau:'); readln(st);

d:=length(st);

writeln('Xau ban vua nhap la: ',st);

writeln('Xau nguoc la: ');

for i:=d downto 1 do

write(st[i]:4);

readln;

end.

uses crt;

var st:string;

begin

clrscr;

write('Nhap xau:'); readln(st);

writeln(length(st));

readln;

end.

3 tháng 3 2021

Chương trình:

program bai_10_chuong_4;

uses crt;

var

s: string[100];

i, dem: integer;

Begin

clrscr;

write('Nhap xau vao:'); readln(s); dem:= 0;

for i:= 1 to length(s) do

if ('0'<=s[i]) and(s[i]<=’9') then dem:=dem+l;

Writeln('Trong xau s co '»dem,' chu so thap phan');

readln;

End.

 

uses crt;

var st:string;

i,d,dem:integer;

begin

clrscr;

write('Nhap xau:'); readln(st);

d:=length(st);

writeln('Xau vua nhap la: ',st);

dem:=0;

for i:=1 to d do 

  if st[i] in ['0'..'9'] then inc(dem);

writeln(dem);

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]=#32 then delete(st,i,1);

writeln('Xau moi la: ',st);

readln;

end.