题解 | #等差数列#
等差数列
http://www.nowcoder.com/practice/f792cb014ed0474fb8f53389e7d9c07f
#include<iostream>
using namespace std;
int main()
{
int d;
while(cin>>d)
{
int sum=0;
int a=2;
while(d--)
{
sum+=a;
a+=3;
}
cout<<sum<<endl;
}
}