Hi, not sure why i get an error in line 16 if I run it without verification. If i try to verify it the first two conditions are met, but not the other two. Any pointers?
Thanks
package com.codegym.task.task04.task0424;
/*
Three numbers
*/
import java.io.*;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) throws Exception {
Scanner scan = new Scanner(System.in);
int num1 = scan.nextInt();
int num2 = scan.nextInt();
int num3 = scan.nextInt();
int list[] = new int[3];
list[1] = num1;
list[2] = num2;
list[3] = num3;
if(list[1] == list[2] && list[1] != list[3]){
System.out.print(3);
}
else if(list[1] == list[3] && list[1] != list[2]){
System.out.print(2);
}
else if(list[2] == list[3] && list[1] != list[3]){
System.out.print(1);
}//write your code here
}
}