#include<iostream>
#define n 100010
using namespace std;
bool c1[100005];
int main(){
int t;
cin>>t;
while(t--){ memset(c1,-1,sizeof(c1));
int tt,a;
scanf("%d",&tt);
for(int i=0;i<tt;i++){
scanf("%d",&a);
c1[a]=true;
}
for(int j=0;j<n-5;j++){
if(c1[j]==true)
printf("%d\n",j);
}
}
return 0;
}
本文展示了一个使用C++进行数组元素标记的例子。通过输入一组整数并标记这些整数出现的位置,最后输出所有被标记的元素。此程序利用了C++标准库中的基本输入输出操作,并展示了如何使用数组来跟踪已标记的元素。
8万+

被折叠的 条评论
为什么被折叠?



