题解 | #尼科彻斯定理#
尼科彻斯定理
https://www.nowcoder.com/practice/dbace3a5b3c4480e86ee3277f3fe1e85
#import <Foundation/Foundation.h> int main(int argc, char* argv[]) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; int num; scanf("%d", &num); // 等差数列第一个元素 int firstNum = num * num - num + 1; for (int i = 0; i < num - 1; i++) { printf("%d+", firstNum); firstNum += 2; } printf("%d\n", firstNum); [pool drain]; return 0; }