Created
June 2, 2014 16:56
-
-
Save tanija/1ccb4e07baf5ad2450ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.StreamCorruptedException; | |
import java.util.Scanner; | |
public class Program4 { | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
int n = input.nextInt(); | |
input.nextLine(); | |
String [] inLine = input.nextLine().split(" "); | |
boolean count = true; | |
for (int i = 0; i < inLine.length; i++) { | |
for (int j = 0; j < inLine.length; j++) { | |
for (int j2 = 0; j2 < inLine.length; j2++) { | |
for (int k = 0; k < inLine.length; k++) { | |
if ((inLine[i]!=inLine[j] && inLine[j] != inLine[j2] && | |
inLine[j2]!=inLine[k]&&inLine[i]!=inLine[j2] && inLine[j] != inLine[k] && | |
inLine[i]!=inLine[k]) &&( (inLine[i]+inLine[j]).equals(inLine[j2]+inLine[k]))){ | |
System.out.println(inLine[i]+"|"+inLine[j]+"=="+inLine[j2]+"|"+inLine[k]); | |
count = false; | |
} | |
} | |
} | |
} | |
} | |
if (count) { | |
System.out.println("No"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment