0分,谁来帮帮我
查看原帖
0分,谁来帮帮我
1150796
b18152098625楼主2024/11/20 13:25
#include<cstdio>
#include<iostream>
#include<string>
using namespace std;
string a[105];
int main()
{
	string s;
	int n=0;
	while(cin>>s)
	{
		a[n++]=s;
	}
	for(int i=1;i<=n-2;++i)
	{
		if(a[i]==a[n-1])
		{
			cout<<a[n]<<" ";
		}
		else 
		{
			cout<<a[i]<<" ";
		}
	}
	return 0;
}
2024/11/20 13:25
加载中...