一片黑炭,求助
查看原帖
一片黑炭,求助
844625
Andy66楼主2024/7/25 16:06
#include<bits/stdc++.h>
using namespace std;
int main(){
	int t,n,x,v,s[100010];
	scanf("%d",&t);
	for(int i=1;i<=t;i++){
		scanf("%d",&n);
		for(int j=1;j<=n;j++)
			cin>>s[j];
		for(int j=1;j<=n;j++){
			for(int k=j+1;k<=n;j++){
				if(s[j]==s[k]){
					s[k]=-1;
				}
			}
		}
		for(int j=1;j<=n;j++)
			if(s[j]!=-1)
				cout<<s[j];
		cout<<endl;
	}
	return 0;
}
2024/7/25 16:06
加载中...