반응형
public class Main {

	public static void main(String[] args) {

		int a = 0, b = 0, c = 0;

		int result = 0;

		for (a = 1; a <= 1000; a++) {

			for (b = a + 1; b <= 1000; b++) {

				for (c = b + 1; c <= 1000; c++) {

					if ((a * a) + (b * b) == (c * c)) {

						if (a + b + c == 1000) {

							result = a * b * c;

						}

					}

				}

			}

		}

		System.out.print(result);

	}

}
반응형

+ Recent posts