public class SQR{
public static void main(String[] args){
sqr(60, 100);
}
public static void sqr(double min, double max){
int low = (int)Math.ceil(Math.sqrt(min));
int high = (int)Math.floor(Math.sqrt(max));
int sum = 0;
for(int i = low; i <= high; i++){
sum += i*i;
}
System.out.println(sum);
System.out.println(low * low);
}
}
Home | Archives | Categories | Tags | About |
|