/* * pe6.c * https://mind.kittttttan.info/c/pe6 */ #include <stdio.h> void pe6(int n) { printf("%d (n = %d)\n", n * (n + 1) * (n - 1) * (3 * n + 2) / 12, n); } int main() { int n; puts("Problem 6:"); while (1) { if (scanf("%d", &n) != 1) { scanf("%*s"); puts("Input Number."); } else { if (!n) { break; } pe6(n); } } return 0; }