All pastes #752794 Raw Edit

Triangle

public java v1 · immutable
#752794 ·published 2007-10-28 19:06 UTC
rendered paste body
package cviceni4;import java.util.Scanner;public class DomaciUkol{    public static void main(String[] args) {        Scanner sc = new Scanner(System.in);        System.out.println("Zadejte prvni stranu trojuhelniku.");        double a = sc.nextDouble();        System.out.println("Zadejte druhou stranu trojuhelniku.");        double b = sc.nextDouble();        System.out.println("Zadejte treti stranu trojuhelniku.");        double c = sc.nextDouble();        double a2 = a*a;        double b2 = b*b;        double c2 = c*c;        double aa = a2 + b2;        double bb = b2 + c2;        double cc = a2 + c2;        boolean ses = true;        if (a < 0 || b < 0 || c < 0){            ses = false;        }        if (a == c && b == c && ses){            System.out.println("Trojuhelnik je rovnostranny.");            System.out.println("Trojuhelnik lze sestrojit.");            System.out.println("Trojuhelnik neni pravouhly.");        }        else if (a+b > c && a+c > b && b+c > a && ses){                System.out.println("Trojuhelnik neni rovnostranny.");                System.out.println("Trojuhelnik lze sestrojit.");                if (a == b || b == c || c == a){                    System.out.println("Trojuhelnik je rovnoramenny.");                    if (aa == c2 || cc == b2 || bb == a2){                        System.out.println("Trojuhelnik je pravouhly.");                    }                    else {                        System.out.println("Trojuhelnik neni pravouhly.");                    }                }                else {                    System.out.println("Trojuhelnik neni rovnoramenny.");                    if (aa == c2 || cc == b2 || bb == a2){                        System.out.println("Trojuhelnik je pravouhly.");                    }                    else {                        System.out.println("Trojuhelnik neni pravouhly.");                    }                }                                        }        else {            System.out.println("Trojuhelnik nelze sestrojit.");        }                    }}