Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class Triangle
  4. {
  5. public static void main(String[]args)
  6. {
  7. Scanner swag = new Scanner (System.in);
  8. System.out.print("Enter side A: ");
  9. int x = swag.nextInt();
  10. System.out.print("Enter side B: ");
  11. int y = swag.nextInt();
  12. System.out.print("Enter side C: ");
  13. int z = swag.nextInt();
  14. int x2 = x*x;
  15. int y2 = y*y;
  16. int z2 =z*z;
  17. if(x2 + y2 == z2 || y2 + z2 == x2 || z2 + x2 == y2)
  18. {
  19. System.out.println("its a triangle that is right");
  20. }
  21. else
  22. {
  23. System.out.println("It is not a right triangle... you're wrong buttface");
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement