题解 | #等差数列#
等差数列
http://www.nowcoder.com/practice/f792cb014ed0474fb8f53389e7d9c07f
#include <stdio.h>
int main(){
long long int n;
while (scanf("%d",&n)!=-1){
printf("%lld\n",((2+3*(n-1))+2)*n/2);
}
return 0;
}
等差数列
http://www.nowcoder.com/practice/f792cb014ed0474fb8f53389e7d9c07f
#include <stdio.h>
int main(){
long long int n;
while (scanf("%d",&n)!=-1){
printf("%lld\n",((2+3*(n-1))+2)*n/2);
}
return 0;
}
相关推荐