Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Triangle
- {
- public static void main(String[]args)
- {
- Scanner swag = new Scanner (System.in);
- System.out.print("Enter side A: ");
- int x = swag.nextInt();
- System.out.print("Enter side B: ");
- int y = swag.nextInt();
- System.out.print("Enter side C: ");
- int z = swag.nextInt();
- int x2 = x*x;
- int y2 = y*y;
- int z2 =z*z;
- if(x2 + y2 == z2 || y2 + z2 == x2 || z2 + x2 == y2)
- {
- System.out.println("its a triangle that is right");
- }
- else
- {
- System.out.println("It is not a right triangle... you're wrong buttface");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement