fork download
  1. #include <stdio.h>
  2. int main() {
  3. int a, b, c, d, freq[37] = {0}, i;
  4. #define _(x) for (x = 0; x <= 9; x++)
  5. _(a) _(b) _(c) _(d) freq[a + b + c + d]++;
  6. for (i = 0; i <= 36; i++) printf("%d\t%d\n", i, freq[i]);
  7. return 0;
  8. }
  9.  
Success #stdin #stdout 0s 4404KB
stdin
Standard input is empty
stdout
0	1
1	4
2	10
3	20
4	35
5	56
6	84
7	120
8	165
9	220
10	282
11	348
12	415
13	480
14	540
15	592
16	633
17	660
18	670
19	660
20	633
21	592
22	540
23	480
24	415
25	348
26	282
27	220
28	165
29	120
30	84
31	56
32	35
33	20
34	10
35	4
36	1