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.

uses crt;
var st,k,t:string;
    d,dem,i:integer;
begin

clrscr;

readln(st);

d:=length(st);

k='';

dem=1;

for i:=2 to d do

      begin 

        if st[i]=st[i-1] then inc(dem);

        if st[i]<>st[i-1] then

        btegin

          str(dem,t);

          if dem>1 then k:=k+t+st[i-1];

          else k:=k+st[i-1];

          dem=1;

        end;

        if (i=d) then 

           begin

           str(dem,t);

           if dem>1 then k:=k+t+st[i];

           else k:=k+st[i];

           end;

    end;

    write(k);

readln;

end.

9 tháng 8 2023

ABABUUC nén sai bạn ơi

 

1 tháng 7 2023

program  Nenxau;

var s: string;
        i, count: integer;
        c: char;

begin
  readln(s);
  count := 1;
  c := s[1];
  for i := 2 to length(s) do
    begin
      if s[i] = c then
        inc(count)
      else
        begin
          write(count);
          write(c);
          count := 1;
          c := s[i];
        end;
    end;
  write(count);
  write(c);
end.

uses crt;

var s:string;

i,d,dem:integer;

begin

clrscr;

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

d:=length(s);

writeln('Cac ki tu so co trong xau S:'); 

dem:=0;

for i:=1 to d do 

  if s[i] in ['0'..'9'] then

begin

write(s[i]:4);

inc(dem);

end;

writeln;

writeln('So ki tu chu so co trong xau S: ',dem);

for i:=1 to d do 

  if s[i] in ['0'..'9'] then s[i]:='A';

writeln('Xau sau khi doi la: ',s);

readln;

end.

14 tháng 3 2023

Var a:array[1..100] of integer;

i,s:integer;

Begin

For i:=1 to 100 do

Begin

Write('Nhap phan tu thu ',i,' = ');readln(a[i]);

If a[i] mod 2 <> 0 then s:=s+a[i];

End;

Write('Tong la ',s);

Readln;

End.

15 tháng 3 2023

em cảm ơn ạ <3

11 tháng 5 2022

tham khảo

 

uses crt;

var a:string;

i,d,dem:integer;

begin

clrscr;

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

dem:=0;

d:=length(a);

for i:=1 to d do

if a[i]=' ' then inc(dem);

writeln(dem);

readln;

end.

24 tháng 3 2023

s = input("Nhập chuỗi: ")

s = ''.join(filter(lambda i: not i.isdigit(), s))

print("Chuỗi sau khi loại bỏ các chữ số: ", s)