fork(1) download
  1. #include <stdio.h>
  2. int main() {
  3. int n;
  4. int count = 0;
  5. printf(" первые 25 тетраэдральные числа:\n");
  6. for (n=0; n <= 25; n++) {
  7. int Tetraid = n * (n+1)* (n + 2)/6;
  8. printf("%5d", Tetraid);
  9. count++;
  10. if (count % 5 == 0) {
  11. printf("\n");
  12. }
  13. }
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
 первые 25 тетраэдральные числа:
    0    1    4   10   20
   35   56   84  120  165
  220  286  364  455  560
  680  816  969 1140 1330
 1540 1771 2024 2300 2600
 2925