Description: Experiment 4: Pythagorean triples purpose of the experiment: a nested for loop. (2) using the cycle counter control. (3) using the strong (a brute force) to solve the problem. Problem Description: right triangle the length of each side can be thought integers. This group represents the integer value of a right triangle each side is known as Pythagorean triples. The three sides must satisfy the following relationship: the square and the square of the hypotenuse is equal to two right angles to the edge. Within the range of 1-500 to identify all side1, side2 and hypotenuse plastic Pythagorean triples. Using a three-layer nested for loop to try all possible situations. The program is an example of " brute force" calculation. In the more advanced computer science courses, you will learn many interesting problems, these problems can only use " brute force" means to be resolved have not yet found the other algorithms. Note: The sample output shows only 17 Pythagorean triples
To Search:
File list (Check if you may need any files):
java3.doc