Skip to main content
deleted 30 characters in body
Source Link

##C++, 219204 bytes

###Golfed

#include<iostream>
#include<string>
int main(){std::string a, b, c;std::cin>>a>>b>>c;int temp=0;fort=0;for(int x=0;x<b.length();x++){temp=at=a.find(b[x],tempt);if(tempt!=-1){a.replace(tempt,1,c.substr(x,1));}}std::cout<<a;return 0;}

###Ungolfed

#include<iostream>
#include<string>

int main()
{
    std::string a, b, c;
    std::cin>>a>>b>>c;
    int tempt = 0;
    for (int x=0;x<b.length();x++) {
        tempt = a.find(b[x], tempt);
        if (tempt != -1) {
            a.replace(tempt,1,c.substr(x, 1));
        }
    }
    std::cout<<a;
    return 0;
}

##C++, 219 bytes

###Golfed

#include<iostream>
#include<string>
int main(){std::string a, b, c;std::cin>>a>>b>>c;int temp=0;for(int x=0;x<b.length();x++){temp=a.find(b[x],temp);if(temp!=-1){a.replace(temp,1,c.substr(x,1));}}std::cout<<a;return 0;}

###Ungolfed

#include<iostream>
#include<string>

int main()
{
    std::string a, b, c;
    std::cin>>a>>b>>c;
    int temp = 0;
    for (int x=0;x<b.length();x++) {
        temp = a.find(b[x], temp);
        if (temp != -1) {
            a.replace(temp,1,c.substr(x, 1));
        }
    }
    std::cout<<a;
    return 0;
}

##C++, 204 bytes

###Golfed

#include<iostream>
#include<string>
int main(){std::string a, b, c;std::cin>>a>>b>>c;int t=0;for(int x=0;x<b.length();x++){t=a.find(b[x],t);if(t!=-1){a.replace(t,1,c.substr(x,1));}}std::cout<<a;return 0;}

###Ungolfed

#include<iostream>
#include<string>

int main()
{
    std::string a, b, c;
    std::cin>>a>>b>>c;
    int t = 0;
    for (int x=0;x<b.length();x++) {
        t = a.find(b[x], t);
        if (t != -1) {
            a.replace(t,1,c.substr(x, 1));
        }
    }
    std::cout<<a;
    return 0;
}
added 93 characters in body
Source Link

##C++, 198219 bytes

###Golfed #include #include int main(){std::string a,b,c;std::cin>>a>>b>>c;for(int x=0;x<b.length();x++){if(a.find(b[x])!=-1){a.replace(a.find(b[x]),1,c.substr(x,1));}}std::cout<<a;return 0;}

#include<iostream>
#include<string>
int main(){std::string a, b, c;std::cin>>a>>b>>c;int temp=0;for(int x=0;x<b.length();x++){temp=a.find(b[x],temp);if(temp!=-1){a.replace(temp,1,c.substr(x,1));}}std::cout<<a;return 0;}

###Ungolfed

#include<iostream>
#include<string>

int main()
{
    std::string a, b, c;
    std::cin>>a>>b>>c;
    int temp = 0;
    for (int x=0;x<b.length();x++) {
        iftemp (= a.find(b[x], temp);
        if (temp != -1) {
            a.replace(a.find(b[x])temp,1,c.substr(x, 1));
        }
    }
    std::cout<<a;
    return 0;
}

##C++, 198 bytes

###Golfed #include #include int main(){std::string a,b,c;std::cin>>a>>b>>c;for(int x=0;x<b.length();x++){if(a.find(b[x])!=-1){a.replace(a.find(b[x]),1,c.substr(x,1));}}std::cout<<a;return 0;}

###Ungolfed

#include<iostream>
#include<string>

int main()
{
    std::string a, b, c;
    std::cin>>a>>b>>c;
    for (int x=0;x<b.length();x++) {
        if (a.find(b[x]) != -1) {
            a.replace(a.find(b[x]),1,c.substr(x, 1));
        }
    }
    std::cout<<a;
    return 0;
}

##C++, 219 bytes

###Golfed

#include<iostream>
#include<string>
int main(){std::string a, b, c;std::cin>>a>>b>>c;int temp=0;for(int x=0;x<b.length();x++){temp=a.find(b[x],temp);if(temp!=-1){a.replace(temp,1,c.substr(x,1));}}std::cout<<a;return 0;}

###Ungolfed

#include<iostream>
#include<string>

int main()
{
    std::string a, b, c;
    std::cin>>a>>b>>c;
    int temp = 0;
    for (int x=0;x<b.length();x++) {
        temp = a.find(b[x], temp);
        if (temp != -1) {
            a.replace(temp,1,c.substr(x, 1));
        }
    }
    std::cout<<a;
    return 0;
}
deleted 16 characters in body
Source Link

##C++, 204198 bytes

###Golfed #include #include using namespace std;intint main(){std::string a,b,c;cin>>a>>b>>c;forc;std::cin>>a>>b>>c;for(int x=0;x<b.length();x++){if(a.find(b[x])!=-1){a.replace(a.find(b[x]),1,c.substr(x,1));}}std::cout<<a;return 0;}

###Ungolfed

#include<iostream>
#include<string>
using namespace std;

int main()
{
    std::string a, b, c;
    std::cin>>a>>b>>c;
    for (int x=0;x<b.length();x++) {
        if (a.find(b[x]) != -1) {
            a.replace(a.find(b[x]),1,c.substr(x, 1));
        }
    }
    std::cout<<a;
    return 0;
}

##C++, 204 bytes

###Golfed #include #include using namespace std;int main(){string a,b,c;cin>>a>>b>>c;for(int x=0;x<b.length();x++){if(a.find(b[x])!=-1){a.replace(a.find(b[x]),1,c.substr(x,1));}}cout<<a;return 0;}

###Ungolfed

#include<iostream>
#include<string>
using namespace std;

int main()
{
    string a, b, c;
    cin>>a>>b>>c;
    for (int x=0;x<b.length();x++) {
        if (a.find(b[x]) != -1) {
            a.replace(a.find(b[x]),1,c.substr(x, 1));
        }
    }
    cout<<a;
    return 0;
}

##C++, 198 bytes

###Golfed #include #include int main(){std::string a,b,c;std::cin>>a>>b>>c;for(int x=0;x<b.length();x++){if(a.find(b[x])!=-1){a.replace(a.find(b[x]),1,c.substr(x,1));}}std::cout<<a;return 0;}

###Ungolfed

#include<iostream>
#include<string>

int main()
{
    std::string a, b, c;
    std::cin>>a>>b>>c;
    for (int x=0;x<b.length();x++) {
        if (a.find(b[x]) != -1) {
            a.replace(a.find(b[x]),1,c.substr(x, 1));
        }
    }
    std::cout<<a;
    return 0;
}
Source Link
Loading