Problem in taking input

how to take integer inputs in one line separated by spaces as in array
ex. 2 4 5 8 10 12