AOJ 592.神奇的叶子

水题

等差数列求和

 1 #include <cstdio>
 2 #include <algorithm>
 3 #include <cstring>
 4 #include <cmath>
 5 #include <string>
 6 #include <iostream>
 7 #include <vector>
 8 using namespace std;
 9 
10 #define REP(n) for(int o=0;o<n;o++)
11 
12 int main() {
13     int a1,n,d;
14     scanf("%d%d%d",&a1,&n,&d);
15     printf("%d
",a1*n + (n*(n - 1)*d) / 2);
16     return 0;
17 }
原文地址:https://www.cnblogs.com/ohyee/p/5252337.html