题解 | #尼科彻斯定理#
尼科彻斯定理
https://www.nowcoder.com/practice/dbace3a5b3c4480e86ee3277f3fe1e85
#include <cmath> #include <iostream> #include <algorithm> #include <string> using namespace std; int main() { int m; cin >> m; int start = pow(m, 2) - m + 1;; string res = to_string(start); start += 2; for (int i=0; i < m-1; i++) { res += "+"; res += to_string(start); start += 2; } cout << res << endl; } // 64 位输出请用 printf("%lld")