08: Output number is not repeated
- View
- Submit
- Statistics
- Questions
-
Total time limit:
-
1000ms
-
Memory Limit:
-
65536kB
-
-
Describe
-
-
Enter n number, from small to general they output, repeat the number output only once. Ensure that there are no more than 500 different numbers.
-
-
Input
-
-
The first line is an integer n. 1 <= n <= 100000.
Then n lines, one integer per line. The integer size is within the range of int.
-
-
Output
-
-
line, from small to large output these numbers, the adjacent two numbers separated by a single space.
-
-
Sample input
-
-
52 4 4) 5 1
-
-
Sample output
-
1 2 4 5
1#include <iostream>2#include <cstdio>3#include <algorithm>4 using namespacestd;5 inta[100010],n,i;6 intMain ()7 {8scanf"%d",&n);9 for(i=1; i<=n;i++)Tenscanf"%d",&a[i]); OneSort (A +0, a+n+1); Aprintf"%d", a[1]); - for(i=2; i<=n;i++) - if(a[i]!=a[i-1]) theprintf"%d", A[i]); - return 0; -}
"Noioj" p7914 (..)