Skip to content

Instantly share code, notes, and snippets.

@StrixG
Created October 18, 2015 20:09
Show Gist options
  • Save StrixG/f7aa7e6d1d3f3b64fdb1 to your computer and use it in GitHub Desktop.
Save StrixG/f7aa7e6d1d3f3b64fdb1 to your computer and use it in GitHub Desktop.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int[] array = new int[in.nextInt()];
for (int i = 0; i < array.length; i++) {
array[i] = in.nextInt();
}
for (int i = 0; i < array.length; i += 2) {
System.out.println(array[i]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment