1.

/*
* ACM Contest training
* Problem: 11479 Is this the easiest problem?
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&page=show_problem&problem=2474
*
* @author Christoph Göttschkes
* @version 1.0, 10/20/2010
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.076
*/

import java.io.*;
import java.util.*;

class Main
{

public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

String line = reader.readLine();

while (true) {
StringTokenizer tokenizer = new StringTokenizer(line);
int testCases = Integer.parseInt(tokenizer.nextToken());

for (int i = 1; i <= testCases; i++) {
line = reader.readLine();
tokenizer = new StringTokenizer(line);
long a = Long.parseLong(tokenizer.nextToken());
long b = Long.parseLong(tokenizer.nextToken());
long c = Long.parseLong(tokenizer.nextToken());
long temp;

if (a > b) {
temp = a;
a = b;
b = temp;
}

if (a > c) {
temp = a;
a = c;
c = temp;
}

if (b > c) {
temp = b;
b = c;
c = temp;
}

System.out.print("Case " + i + ": ");

if (a + b <= c) {
System.out.println("Invalid");
} else {
if (a == b && a == c && c == b)
System.out.println("Equilateral");
else if (a == b || a == c || c == b)
System.out.println("Isosceles");
else
System.out.println("Scalene");
}
}
if (!reader.ready())
break;
line = reader.readLine();
}
}
}



2.
/** * FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS10
* * Problem: 11479 Is this the easiest problem?
* * Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=26&page=show_problem&problem=2474
* * Savkina Ekaterina
* * @version 1.0, 22/04/2010
* * Status : Accepted
* * Runtime: 0.112 */

import java.util.*;

public class triangle {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int count = sc.nextInt();

for (int i = 1; i <= count; i++) {
/*
* Einlesen von Längen der Seiten
*/
long a = sc.nextLong();
long b = sc.nextLong();
long c = sc.nextLong();

/*
* Die Längen der seiten werden in einem Array gespeichert.
* Array wird sortiert, damit kann man bestimmen, welche Seite die längste ist.
*/
long[] d = new long[3];

d[0] = a;
d[1] = b;
d[2] = c;
Arrays.sort(d);

/*
* Zuerst wird geprüft, ob es überhaupt ein Dreieck ist.
*/
if (d[0] + d[1] > d[2] && a > 0 && b > 0 && c > 0) {

/*
* Falls alle Seiten gleich sind ...
*/
if (a == b && b == c)
System.out.println("Case " + i + ": Equilateral");

/*
* Falls alle Seiten ungleich sind ...
*/
else if (a == b || b == c || a == c)
System.out.println("Case " + i + ": Isosceles");

else
System.out.println("Case " + i + ": Scalene");
}

/*
* Falls es kein Dreieck ist ...
*/
else
System.out.println("Case " + i + ": Invalid");

}

}
}