Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Min Quadrato
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { int m; m=0; for(int n=4;n<=100;n++){ for(int a=2;a<=100;a++){ double y; y=0.0; y=0.25*(n*(2*a+n-1)*(2*Math.pow(a,2)+2*a*(n-1)+n*(n-1))); if ((Math.sqrt(y)==(int)Math.sqrt(y))) { if ((y<m) || (m==0)) m=(int)y; // System.out.println(y); } } } System.out.println(m); } }
run
|
edit
|
history
|
help
0
Problem 3: New Products
Print Longest String
4.C
Recursive list fields
pass
191fa07050(1(D))
[a-zA-Z ]{0,12}
Magic No.
piglatin
fs