6 solutions

  • 1
    @ 2026-6-6 13:43:06
    #include<bits/stdc++.h>
    using namespace std;
    const int N=210;
    char a[N];
    int main(){
        char A,B;
        cin.getline(a,200);
        cin>>A>>B;
        for(int i=0;i<=strlen(a)-1;i++){
            if(a[i]==A) a[i]=B;
        }
        cout<<a;
        return 0;
    }
    

    Information

    ID
    83
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    # Submissions
    170
    Accepted
    71
    Uploaded By