题解 | #等差数列#
等差数列
http://www.nowcoder.com/practice/f792cb014ed0474fb8f53389e7d9c07f
#include<stdio.h>
int main(){
int a1=2,d=3,an=0,n=0,Sn=0;
while(scanf("%d",&n)==1){
an=a1+(n-1)*d;
Sn=(a1+an)*n/2;
printf("%d",Sn);
}
}