class Polynom { public static void main (String[] args) throws java.lang.Exception { Scanner scan = new Scanner(System.in); System.out.println("введите а: "); int a = scan.nextInt(); System.out.println("введите b: "); int b = scan.nextInt(); System.out.println("введите n: "); int n = scan.nextInt(); System.out.println("значение полинома: " + ( Math.pow(a,n) + Math.pow(b,n-1) ) ); } }
import java.lang.*;
import java.io.*;
class Polynom
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner scan = new Scanner(System.in);
System.out.println("введите а: ");
int a = scan.nextInt();
System.out.println("введите b: ");
int b = scan.nextInt();
System.out.println("введите n: ");
int n = scan.nextInt();
System.out.println("значение полинома: "
+ ( Math.pow(a,n) + Math.pow(b,n-1) ) );
}
}