题解 | #尼科彻斯定理#
尼科彻斯定理
https://www.nowcoder.com/practice/dbace3a5b3c4480e86ee3277f3fe1e85
#include <stdio.h> #include<math.h> int main() { int m = 0; scanf("%d", &m); int n = pow(m,3); int i = 1; while(1) { if(n == i*m + m*(m-1)) { int j = 0; for(j=0; j<m-1; j++) { printf("%d+", i); i += 2; } printf("%d",i); break; } else { i += 2; } } return 0; }