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.
![](https://rs.olm.vn/images/avt/0.png?1311)
#include <bits/stdc++.h>
using namespace std;
string a,b;
void replaceSubstring(string& a, const string& b) {
size_t pos=0;
while((pos=a.find(b,pos))!=string::npos) {
a.replace(pos,b.length(),"ABC");
pos+=3;
}
}
int main()
{
cin>>a>>b;
if(a.find(b)!=string::npos){
cout<<"YES"<<endl;
replaceSubstring(a,b);
cout<<a;
}else{
cout<<"NO"<<endl;
cout<<a;
}
return 0;
}
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
var st1:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st1);
d:=length(st1);
for i:=1 to d do
if (st1[i]='a') and (st1[i+1]='b') and (st1[i+2]='c') then delete(st1,i,3);
writeln(st1);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
Câu 1:
uses crt;
var st:string;
d,i,dem:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
write('Xau sau khi xoa so la: ');
for i:=1 to d do
if not(st[i] in ['0'..'9']) then write(st[i]);
writeln;
dem:=0;
for i:=1 to d do
if st[i]=#32 then inc(dem);
writeln('Xau co ',dem,' dau cach');
writeln('Do dai cua xau la: ',d);
readln;
end.
Câu 2:
uses crt;
const fi='kq.out';
var st1,st2:string;
f1:text;
begin
clrscr;
write('Nhap xau thu 1:'); readln(st1);
write('Nhap xau thu 2:'); readln(st2);
assign(f1,fi); rewrite(f1);
if length(st2)>length(st1) then writeln(f1,st2)
else writeln(f1,st1);
close(f1);
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
var st1,st2:string;
begin
clrscr;
readln(st1,st2);
if st1>st2 then writeln('Xau st1 lon hon')
else if st2>st1 then writeln('Xau st2 lon hon')
else writeln('Hai xau bang nhau');
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
PROGRAM XAU;
USES crt;
VAR N1 ; N2 : String;
a ; i :Bytbe;
BEGIN
clrscr;
write(' Nhap xau N1:') ; Readln(N1);
N2:=' ';
for i:=1 to Length(N1) do
If ( 'a'<=N1
moa cai dau doi ty qua kia lam
![](https://rs.olm.vn/images/avt/0.png?1311)
tk
uses crt;
var st1:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st1);
d:=length(st1);
for i:=1 to d do
if (st1[i]='a') and (st1[i+1]='b') and (st1[i+2]='c') then delete(st1,i,3);
writeln(st1);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
1:
#include <bits/stdc++.h>
using namespace std;
string st;
int d,i;
int main()
{
getline(cin,st);
d=st.length();
for (i=d-1; i>=0; i--) cout<<st[i];
return 0;
}