View Code of Problem 90

import  java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.nextLine();
		String[] ss = s.split(",");
		int a = Integer.parseInt(ss[0]);
		int b = Integer.parseInt(ss[1]);
		for(int i=a; i<=b; i++) {
			for(int j=i; j<=b; j++) {
				for(int k=i; k<=b; k++) {
					if( i*i + j*j == k*k) {
						System.out.printf("%d^2+%d^2=%d^2\n",i,j,k);
					}
				}
			}
		}
	}
}

Double click to view unformatted code.


Back to problem 90