Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Solution
- {
- public static void main (String[] args) throws Exception
- {
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- //объявляем масив типа int с тремя значениями
- int[] ar = new int[3];
- //заполняем массив с помощью reader присваивая индекс i
- for (int i = 0; i < 3; i++){
- ar[i] = Integer.parseInt(reader.readLine());
- }
- /*проходим по элементам массива,
- с каждым элементом делаем второй проход
- и считаем к-во равные ему
- */
- for (int i : ar){
- int count = 0;
- for (int j : ar){
- if (i==j){
- count++;
- }
- }
- if (count = 1) {
- System.out.println(i);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement