秋祭 | 静岡高校工学部



卬高杯


提出詳細

提出id提出時刻ユーザー名問題言語判定状況判定実行時間
1150212023-10-25 23:19:03ABcpp18/18AC8

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

int main() {
    string inputString = "あなたのXは素晴らしいX";
cin>> inputString;
    
    // "X" を "Twitter" に置換
    size_t found = inputString.find("X");
    while (found != string::npos) {
        inputString.replace(found, 1, "Twitter");
        found = inputString.find("X", found + 7); // 7 は "Twitter" の文字数です
    }
    
    cout << inputString << endl;

    return 0;
}

sample1.txt AC 2
sample2.txt AC 2
sample3.txt AC 3
case1.txt AC 7
case2.txt AC 8
case3.txt AC 8
case4.txt AC 8
case5.txt AC 8
case6.txt AC 8
case7.txt AC 8
case8.txt AC 8
case9.txt AC 8
case10.txt AC 8
case11.txt AC 8
case12.txt AC 8
case13.txt AC 8
case14.txt AC 8
case15.txt AC 8
8 AC8 AC