Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package dadaproject.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- checker(0,1,10,12,4,5,6,7,8);
- }
- static void checker(int ...m) {
- int counter = 0;
- for (int i = 0; i < m.length; i++) {
- if ((i % 2) != (m[i] % 2))
- {
- counter = 1;
- break;
- }
- }
- if (counter==1)
- {
- System.out.print("Bad array");
- }
- else
- System.out.print("Good array");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement