Những câu hỏi liên quan
U Lan
Xem chi tiết
U Lan
Xem chi tiết
U Lan
Xem chi tiết
U Lan
Xem chi tiết
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)
Nam Hải
Xem chi tiết
Phía sau một cô gái
17 tháng 3 2023 lúc 22:45

xau = input("Nhập vào một xâu bất kì: ")

xau_moi = xau.replace("choi", "hoc")

print("Xâu mới sau khi thay thế là:", xau_moi)

Bình luận (0)
Minh Lệ
17 tháng 3 2023 lúc 23:13

Program HOC24;

var s: string;

d: byte;

begin

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

while pos('choi',s)<>0 do

begin

d:=pos('choi',s);

delete(s,d,4);

insert('hoc',s,d);

end;

write('Xau sau khi thay la: ',s);

readln

end.

Bình luận (0)
Ngọc Hồng
Xem chi tiết
Nguyễn Lê Phước Thịnh
17 tháng 3 2022 lúc 14:48

#include <bits/stdc++.h>

using namespace std;

string st;

int d,i,dem;

int main()

{

freopen("xau.inp","r",stdin);

freopen("xau.out","w",stdout);

cin>>st;

d=st.length();

dem=0;

for (i=0; i<=d-1; i++)

if (st[i]=='a') dem++;

cout<<dem;

return 0;

}

Bình luận (0)
Huy Nguyễn Văn
Xem chi tiết