Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class main
  4. {
  5. public static void main(String[] args) {
  6.  
  7.  
  8. {
  9.  
  10. Scanner input = new Scanner(System.in);
  11. System.out.println("podaj a");
  12. int a = input.nextInt();
  13. System.out.println("podaj b");
  14. int b = input.nextInt();
  15. System.out.println("podaj c");
  16. int c = input.nextInt();
  17. if (a >= b && a >= c) {
  18. if (a * a == b * b + c * c) {
  19. System.out.println("To trojkat prostokatny");
  20.  
  21.  
  22. } else {
  23. System.out.println("to nie jest prosokatny");
  24. }
  25. if (b == c) {
  26. System.out.println("jest rownoramienny");
  27. } else {
  28. System.out.println("nie jest rownoramienny");
  29. }
  30. if (a==b && b==c && c==a)
  31. {
  32. System.out.println("jest rownoboczny");
  33.  
  34. }else
  35. {
  36. System.out.println("nie jest rownoboczny");
  37. }
  38. }else if(b>=a && b>=c)
  39. {
  40. if (b * b == a * a + c * c) {
  41. System.out.println("To trojkat prostokatny");
  42.  
  43.  
  44. } else {
  45. System.out.println("to nie jest prosokatny");
  46. }
  47. if (a == c) {
  48. System.out.println("jest rownoramienny");
  49. } else {
  50. System.out.println("nie jest rownoramienny");
  51. }
  52. if (a==b && b==c && c==a) {
  53. System.out.println("jest rownoboczny");
  54.  
  55.  
  56. }else
  57. {
  58. System.out.println("nie jest rownoboczny");
  59. }
  60. }else if (c>=a && c>=b)
  61. {
  62. if (c * c == a * a + b * b) {
  63. System.out.println("To trojkat prostokatny");
  64.  
  65.  
  66. } else {
  67. System.out.println("to nie jest prosokatny");
  68. }
  69. if (a == b) {
  70. System.out.println("jest rownoramienny");
  71. } else {
  72. System.out.println("nie jest rownoramienny");
  73. }
  74. if (a==b && b==c && c==a) {
  75. System.out.println("jest rownoboczny");
  76.  
  77.  
  78. }else
  79. {
  80. System.out.println("nie jest rownoboczny");
  81. }
  82.  
  83. }else
  84. {
  85. System.out.println("nie ma takiego trojkata");
  86. }
  87. }
  88.  
  89.  
  90.  
  91. }
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement