What am I doing wrong?
Edit: lines 28-34 aren't there. And the if statement is inside the first for loop which uses i as a counter;
package com.codegym.task.task07.task0706;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
/*
Streets and houses
*/
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
int odd = 0;
int even = 0;
Scanner sc = new Scanner(System.in);
int nums [] = new int [15];
//fills array
for(int i = 0; i < 15; i++)
{
nums[i] = sc.nextInt();
}
for(int j = 0; j<nums.length; j++)
{
if(nums[j] % 2 == 0)
even+=nums[j];
else
odd+=nums[j];
}
if(even>odd)
System.out.print("Even-numbered houses have more residents.");
else
System.out.print("Odd-numbered houses have more residents.");
}
}