chillurbrain

Task1Lab5_2

Dec 9th, 2015
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class Task1_5_2 {
  4. public static void main(String[] args) {
  5. Scanner sc = new Scanner(System.in);
  6. int n = sc.nextInt();
  7. int[] numArr = new int[n];
  8. for (int i = 0; i < n; i++) {
  9. numArr[i] = sc.nextInt();
  10. }
  11. for (int j = 0; j < n; j += 2) {
  12. System.out.print(numArr[j] + " ");
  13. }
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment