#include <stdio.h> main() { int i, j = 0, sum = 0, square_sum = 0, cubic_sum = 0; scanf("%d", &i); do { j++; sum += j; square_sum += j * j; cubic_sum += j * j * j; } while (j < i); printf("%d\n", sum); printf("%d\n", square_sum); printf("%d\n", cubic_sum); } |