kleiner reformat
Signed-off-by: Johannes Theiner <j.theiner@live.de>
This commit is contained in:
parent
2158161106
commit
ce2ce5d880
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
*.iml
|
*.iml
|
||||||
.idea
|
.idea
|
||||||
|
target
|
@ -1,25 +1,25 @@
|
|||||||
package de.hsel.sqs;
|
package de.hsel.sqs;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Johannes Theiner
|
* @author Julian Hinxlage
|
||||||
* @version 0.1
|
* @version 0.1
|
||||||
* @since 0.1
|
* @since 0.1
|
||||||
**/
|
**/
|
||||||
public class TriangleChecker {
|
public class TriangleChecker {
|
||||||
|
|
||||||
public static TriangleType checkTriangle(int a, int b, int c) {
|
public static TriangleType checkTriangle(int a, int b, int c) {
|
||||||
if(a < 0 || b < 0 || c < 0){
|
if (a < 0 || b < 0 || c < 0)
|
||||||
return TriangleType.NO_TRIANGLE;
|
return TriangleType.NO_TRIANGLE;
|
||||||
}
|
|
||||||
if(a == b && a == c){
|
if (a == b && a == c)
|
||||||
return TriangleType.EQUILATERAL_TRIANGLE;
|
return TriangleType.EQUILATERAL_TRIANGLE;
|
||||||
}
|
|
||||||
if(a == b || a == c || b == c){
|
if (a == b || a == c || b == c)
|
||||||
return TriangleType.ISOSCELESS_TRIANGLE;
|
return TriangleType.ISOSCELESS_TRIANGLE;
|
||||||
}
|
|
||||||
if(a + b > c && a + c > b && b + c > a){
|
if (a + b > c && a + c > b && b + c > a)
|
||||||
return TriangleType.SCALENE_TRIANGLE;
|
return TriangleType.SCALENE_TRIANGLE;
|
||||||
}
|
|
||||||
return TriangleType.NO_TRIANGLE;
|
return TriangleType.NO_TRIANGLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user