Triangle.java

public class Triangle {
 
	enum Type { Equilateral, Isosceles, Scalene }
 
	static Type checkType(int a, int b, int c) {
		if((a==b) && (b==c))
			return Type.Equilateral;
		else if((a==b) || (b==c) || (a==c))
			return Type.Isosceles;
		else	
			return Type.Scalene;
	}
}
software_testing/lect02_triangle.txt · Last modified: 2008/11/07 03:15 by jittat
 
 
©2008 Another cool website by 80KV