fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. const int limit = 100;
  6.  
  7. int next(void)
  8. {
  9. return rand() % limit;
  10. }
  11.  
  12. int main(void)
  13. {
  14. srand(time(0));
  15.  
  16. unsigned columns = 12;
  17. unsigned line_width = 80;
  18. unsigned field_width = line_width / columns;
  19.  
  20. for (unsigned i = 0; i < 156; ++i)
  21. {
  22. printf("%*i", field_width, next());
  23.  
  24. if ((i + 1) % columns == 0)
  25. printf("\n");
  26. }
  27. }
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
    90    77    71    35    49    30    13    35    34    42    84    12
    35    94    55    12    97    40    84    35    36    27    57    46
     5    29    14    75    48    61    66    90    90    37    77    39
    19    91    27    53    85    63    17    20    57    24    32     7
    64    68    42    52    95    51    99    53    80    13    80    29
    26    46    19    17    35    97     8    54    40    35    59    25
    98    76    97     8     0    81    15    17    50     9    21    97
    60    20     2    41    85    83    70    64    81    41    33    69
    38    93    75    30    29    35     7    79    11     4    39    64
    86    54    81    88    63     2    85    76    75    88    17    12
    23    39    76     4    80    61    25    71    55     1     1    36
    36    61    15    99    65     7    63     3    61    96    91    77
    51    29    53    78    69    70    90    92     9    19    48    41