#include <iostream>
#include <string>
using namespace std;
int main() {
    string sentence = "あなたは仲間と共に魔王を倒す旅に出た。";
    string keyword = "仲間と共に魔王を倒す";
    string newword = "一人で神龍を探す";
    int pos = sentence.find(keyword);
    int len = keyword.length();
    cout << "元の文:" << sentence << endl;
    sentence.replace(pos, len, newword);
    cout << "変更後:" << sentence << endl;
}
