题解 | #尼科彻斯定理#
尼科彻斯定理
https://www.nowcoder.com/practice/dbace3a5b3c4480e86ee3277f3fe1e85
#include <stdio.h> //重点:把等差数列的首项找到 int main() { int m, first_num,i; int a[100]={0}; while (scanf("%d", &m) != EOF) { if (m>=1&&m<=100){ first_num=m*(m-1)+1; for (i=0; i<m; i++){ a[i]=first_num+2*i; if (i!=m-1) printf("%d+", a[i]); else printf("%d\n",a[i]); } } } return 0; }