Created
October 18, 2015 20:09
-
-
Save StrixG/f7aa7e6d1d3f3b64fdb1 to your computer and use it in GitHub Desktop.
A[0], A[2], A[4], ... http://informatics.mccme.ru/mod/statements/view3.php?id=12660&chapterid=63#1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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