题解 | 明明的随机数
明明的随机数
https://www.nowcoder.com/practice/3245215fffb84b7b81285493eae92ff0
#include <iostream>
using namespace std;
int main() {
bool *list = new bool[501];
int num;
cin>>num;
for(int i=0;i<num;i++){
int temp;
cin>>temp;
list[temp]=1;
}
for(int i =1;i<502;i++){
if(list[i]==1) cout<<i<<endl;
}
return 0;
}
这题真能算困难吗?

查看4道真题和解析