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