import java.util.Scanner;
public class Q232630278 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double[] a = new double[7];
for (int i = 0; i < a.length; i++) {
a[i] = scanner.nextDouble();
}
System.out.println(task(a, 1));
System.out.println(task(a, 3));
System.out.println(task(a, 4));
}
private static double task(double[] a, int x) {
return p(a, x + 1) - p(a, x);
}
private static double p(double[] a, int x) {
double r = 0;
for (int i = 0; i < a.length; i++) {
r += pn(a[i], x, i);
}
return r;
}
private static double pn(double a, int x, int n) {
if (x == 1) {
return 1;
}
for (int i = 0; i < n; i++) {
x *= x;
}
return a * x;
}
}
Показать перегрузку метода и параметр переменной длины.