#include <stdio.h> #include <stdlib.h>

int main() { int n = 1; int sum = 0; int term = 1; while (abs(sum) <= 3000) { sum += term; term = term * (-1) * n * (n + 1) * (n + 2); n++; } printf("The sum is %d\n", sum); return 0; }


原文地址: https://www.cveoy.top/t/topic/coNo 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录