题解 | #明明的随机数#
明明的随机数
http://www.nowcoder.com/practice/3245215fffb84b7b81285493eae92ff0
package main
import(
"fmt"
)
func main(){
N := 0
fmt.Scan(&N)
narr := make([]int,501)
n := 0
for i := 0; i < N; i++ {
fmt.Scan(&n)
if narr[n] > 0 {
continue
}
narr[n] = 1
}
for i := range narr {
if narr[i] > 0 {
fmt.Println(i)
}
}
}