题目:
/**
* 等差数列:
* 求等差数列前N项的级数之和。不考虑不合理的输入等特殊情况
* 输入N,首项M,差值K,整型,空格分隔。
*/
解答:
class Test93 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
// code here
int n = input.nextInt();
int m = input.nextInt();
int k = input.nextInt();
System.out.println(n * m + n * (n - 1) * k / 2);
input.close();
}
}
标签:Scanner,int,System,nextInt,input,等差数列
From: https://www.cnblogs.com/chen-zhou1027/p/17471467.html