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