题解 | #尼科彻斯定理#
尼科彻斯定理
http://www.nowcoder.com/practice/dbace3a5b3c4480e86ee3277f3fe1e85
#include <stdio.h>
int main(void)
{
int data, start;
int i;
scanf("%d", &data);
if (data % 2) {
start = data * data - (data / 2 ) * 2;
} else {
start = data * data - (data / 2) * 2 + 1;
}
for (i = 0; i < data - 1; i++) {
printf("%d+", start + 2 * i);
}
printf("%d\n", start + 2 * i);
return 0;
}