题解 | #明明的随机数#
明明的随机数
http://www.nowcoder.com/practice/3245215fffb84b7b81285493eae92ff0
#include <stdio.h> static int g_int[500] = {0}; static int num, tmp, i; int main(int argc, char** argv) { while (scanf("%d", &num) != EOF) { for (i = 0; i < num; i++) if (scanf("%d", &tmp)) g_int[--tmp]++; for (i = 0; i < 500;) if (g_int[i++]) printf("%d\n", i); } return 0; }