| 1 | package seminar7;\r |
| 2 | \r |
| 3 | import java.util.*;\r |
| 4 | \r |
| 5 | public class Metody {\r |
| 6 | \r |
| 7 | public static void main(String[] args) {\r |
| 8 | \r |
| 9 | Scanner sca = new Scanner(System.in);\r |
| 10 | int a = sca.nextInt();\r |
| 11 | int b = sca.nextInt();\r |
| 12 | int c = sca.nextInt();\r |
| 13 | \r |
| 14 | over(a,b,c);\r |
| 15 | pravouhly(a,b,c);\r |
| 16 | obvod(a,b,c);\r |
| 17 | //obsah(a,b,c);\r |
| 18 | }\r |
| 19 | \r |
| 20 | static void over(int a, int b, int c)\r |
| 21 | {\r |
| 22 | int j = 1;\r |
| 23 | if((a+b) < c)\r |
| 24 | j = 0;\r |
| 25 | if((b+c) < a)\r |
| 26 | j = 0;\r |
| 27 | if((c+a) < b)\r |
| 28 | j = 0;\r |
| 29 | if(j == 0);\r |
| 30 | System.out.println("Neni trojuhelnik!");\r |
| 31 | }\r |
| 32 | \r |
| 33 | static void obvod(int a, int b, int c)\r |
| 34 | {\r |
| 35 | int o = (a + b + c);\r |
| 36 | System.out.println("Obvod O = " + o);\r |
| 37 | }\r |
| 38 | \r |
| 39 | static void obsah(int a, int b, int c)\r |
| 40 | {\r |
| 41 | int o = (a + b + c); // Zatim obvod\r |
| 42 | System.out.println("Obsah S = " + o);\r |
| 43 | }\r |
| 44 | \r |
| 45 | static void pravouhly(int a, int b, int c)\r |
| 46 | {\r |
| 47 | int sa = 0, sb = 0, sc = 0;\r |
| 48 | if(((a * a) + (b * b)) == (c * c))\r |
| 49 | {\r |
| 50 | sa = a;\r |
| 51 | sb = b;\r |
| 52 | sc = c;\r |
| 53 | }\r |
| 54 | \r |
| 55 | if(((c * c) + (b * b)) == (a * a))\r |
| 56 | {\r |
| 57 | sa = c;\r |
| 58 | sb = b;\r |
| 59 | sc = a;\r |
| 60 | }\r |
| 61 | \r |
| 62 | if(((a * a) + (c * c)) == (b * b))\r |
| 63 | {\r |
| 64 | sa = a;\r |
| 65 | sb = c;\r |
| 66 | sc = b;\r |
| 67 | }\r |
| 68 | \r |
| 69 | if((sa * sa + sb * sb) != (sc * sc))\r |
| 70 | System.out.println("Neni pravouhly!");\r |
| 71 | }\r |
| 72 | \r |
| 73 | }\r |