Hey,
I'm not that familiar with arrays and I have trouble finding the solution. Could somebody explain to me what is wrong?
package com.codegym.task.task04.task0424;
/*
Three numbers
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
int a = Integer.parseInt(reader.readLine());
int b = Integer.parseInt(reader.readLine());
int c = Integer.parseInt(reader.readLine());
int [] arr = new int[3];
arr[1] = a;
arr[2] = b;
arr[3] = c;
unterschied(arr);
}
public static void unterschied(int [] arr){
if (arr[1] == arr[2] && arr[1] != arr[3]){
System.out.println(arr[3]);
}
else if (arr[2] == arr[3] && arr[2] != arr[1]){
System.out.println(arr[1]);
}
else if (arr[3] == arr[1] && arr[3] != arr[2]){
System.out.println(arr[2]);
}
}
}