Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  Pitagoras2
Language: JAVA
Code:


public class Pitagoras2
{
     public static void main( String[] args )
     {
          int side1=0;
          int side2=0;
          int side3=0;
          boolean isRect;
          Pit triangulo = new Pit(side1, side2, side3);
     
          for (int s1 = 1; s1 <=100 ; s1++)
               for (int s2 =1; s2 <=100; s2++)
                    for (int s3 = 1; s3 <=100; s3++)  // La variable de control es el lado
                    {
                         side1 = s1;
                         side2 = s2;
                         side3 = s3;
                    
                         triangulo.ordenar (side1, side2, side3);
                         if (triangulo.isRect(side1, side2, side3))
                              System.out.println(side1 + ", " +side2 + ", " + side3);
                    }
     }
}
     
Comments: