package com.codegym.task.task04.task0417;
/*
Do we have a pair?
*/
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 n1 = Integer.parseInt(reader.readLine());
int n2 = Integer.parseInt(reader.readLine());
int n3 = Integer.parseInt(reader.readLine());
if((n1 == n2) && (n1 == n3))
{
System.out.println(n1 + " " + n2 + " " +n3);
}
else if (n1 == n2)
{
System.out.println(n1 + " " + n2);
}
else if(n2 == n3)
{
System.out.println(n2 + " " + n3);
}
else
{
System.out.println(n3 + " " + n1);
}
}
public static boolean isPair(int n1 , int n2, int n3)
{
return((n1 == n2) || (n2 == n3) || (n3 == n1));
}
}
hidden #10526041
Level 5
Please tell me what's the problem in my code last condition is not verified
Under discussion
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Guadalupe Gagnon
20 November 2019, 16:30
This program will output something even if no pair exists
0