0!求助!
查看原帖
0!求助!
838777
a11451419198102333楼主2024/10/10 21:06
#include<bits/stdc++.h>
using namespace std;
int Random(int x)
{
	return rand() % x;
}
int main()
{
//	freopen(".in", "r", stdin);
//	freopen(".out", "w", stdout);
	srand(time(0));
	string s;
	char ch;
	vector<string> v;
	while(cin >> s)
	{
	  ch = getchar();
		v.push_back(s);
	  if(ch == 10)
	  {
	    break;
	  }
	}
	string x;
	string y;
	cin >> x >> y;
	for(auto i : v)
	{
		cout << ((i == x) ? y : i) << " ";
	}
	return 0;
}

以上便是我写的代码,有什么问题吗???

2024/10/10 21:06
加载中...