????
查看原帖
????
1020566
prg_equal_depressed楼主2024/5/13 21:02
#include <iostream>
#include <fstream> 
using namespace std;
int n,m,a[1005],x[1005];
bool f;
int main(){
	//freopen("B3842.in","r",stdin);
	//freopen("B3842.out","w",stdout);
	cin>>n>>m;
	for (int i=1;i<=m;i++){
		cin>>a[i];
		x[a[i]]++;
	}
	for (int i=0;i<n;i++){
		if (x[i]==0){
			cout<<i<<" ";f=1;
		}
	}
	if (!f) cout<<n;
	//fclose(stdin);
	//fclose(stdout);
	return 0;
}

没找出来错哪了,可能来个大佬指教一下QWQ

2024/5/13 21:02
加载中...