Những câu hỏi liên quan
Khánh Mỹ
Xem chi tiết
Nguyễn Lê Phước Thịnh
21 tháng 4 2021 lúc 19:21

const fi='input.txt'

fo='output.txt'

var f1,f2:text;

st:string[125];

a:array[1..125]of string;

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

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

readln(f1,st);

d:=length(st);

dem:=1;

a[1]:=st[1];

for i:=1 to d do

  begin

kt:=0;

for j:=1 to dem do 

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

if kt=0 then 

begin

inc(dem);

a[dem]:=st[i];

end;

end;

for i:=1 to dem do 

  begin

dem1:=0;

for j:=1 to d do 

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

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

end;

close(f1);

close(f2);

end.

Bình luận (0)
LA VAN CAU
Xem chi tiết
nguyen dao
Xem chi tiết
Nguyễn Lê Phước Thịnh
7 tháng 5 2021 lúc 21:09

const fi='vao.inp'

fo='ra.out'

var f1,f2:text;

st:string;

i,d:integer;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

readln(f1,st);

d:=length(st);

for i:=1 to d do 

  if st[i]='a' then delete(st,i,1);

writeln(f2,st);

close(f1);

close(f2);

end.

Bình luận (0)
Lê Hoàng Dương
Xem chi tiết
Minh Lệ
26 tháng 2 2021 lúc 17:06

Program HOC24;

const fi='bai24.inp'

fo='bai24.out'

var f: text;

s: string;

procedure ip;

begin

assign(f,fi);

reset(f);

read(f,s);

close(f);

end;

procedure out;

begin

assign(f,fo);

rewrite(f);

if s='palindrome' then write(f,'La xau palindrome') else write(f,'Khong phai xau palindrome');

close(f);

end;

begin

ip;

out;

end.

Bình luận (3)
Nguyễn Lê Phước Thịnh
26 tháng 2 2021 lúc 21:24

const fi='bai24.inp'

fo='bai24.out'

var f1,f2:text;

s:string;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

readln(f1,s);

if s='palindrome' then writeln(f2,'Phai')

else writeln(f2,'Khong phai');

close(f1);

close(f2);

end.

Bình luận (0)
Official LEEZ
Xem chi tiết
Minh Lệ
21 tháng 3 2023 lúc 12:16

Program HOC24;

var s: string;

i,d: byte;

f1,f2: text;

fi='Xau.mp'

fo='KQ.Out'

begin

assign(f1,fi);

assign(f2,fo);

reset(f1);

rewrite(f2);

readln(f1,s);

d:=0;

for i:=1 to length(s) do if s[i]='a' then d:=d+1;

write(f2,d);

close(f1); close(f2);

end.

Bình luận (0)
Lala
Xem chi tiết
datcoder
17 tháng 11 2023 lúc 0:18

#include <bits/stdc++.h>

using namespace std;

int main() {

freopen("VIRUS.INP","r",stdin);

freopen("VIRUS.OUT","w",stdout);

string S, R;

cin >> S >> R;

while(S.find(R) >= 0) {

int p = S.find(R);

if (p >= 0) S.erase(p,R.length());

else break;

}

cout<<S;

return 0;

}

Bình luận (0)
U Lan
Xem chi tiết
U Lan
Xem chi tiết
U Lan
Xem chi tiết