题解 | #明明的随机数#
明明的随机数
https://www.nowcoder.com/practice/3245215fffb84b7b81285493eae92ff0
#include <stdio.h> int main() { int n; int a; while(scanf("%d",&n) != EOF) { int count[501] = {0}; int i; for(i=0; i<n; i++) { scanf("%d",&a); count[a] = 1; } for(i=0; i<501; i++) //哈希,已知整数范围 { if(count[i] == 1) { printf("%d\n", i); } } } return 0; }