题目描述
对用户输入的任一整数,输出以下多项式的值。
y=2x2+x+8
输入
输入整数x的值。
输出
输出一个整数,即多项式的值。
样例输入 Copy
1
样例输出 Copy
11
来源/分类
*
代码
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x,y;
while (sc.hasNext()) {
x = sc.nextInt();
y = 2*x*x + x + 8;
System.out.println(y);
}
}
}