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