Mercurial > hg > Papers > 2017 > atton-master
annotate paper/src/factrial.cbc @ 35:26c89a10de3c
Update TODO
author | atton <atton@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 28 Jan 2017 09:47:44 +0900 |
parents | 6dedd4ed6b6d |
children |
rev | line source |
---|---|
15 | 1 __code print_factorial(int prod) |
2 { | |
3 printf("factorial = %d\n", prod); | |
4 exit(0); | |
5 } | |
6 | |
7 __code factorial0(int prod, int x) | |
8 { | |
9 if (x >= 1) { | |
10 goto factorial0(prod*x, x-1); | |
11 } else { | |
12 goto print_factorial(prod); | |
13 } | |
14 | |
15 } | |
16 | |
17 __code factorial(int x) | |
18 { | |
19 goto factorial0(1, x); | |
20 } | |
21 | |
22 int main(int argc, char **argv) | |
23 { | |
24 int i; | |
25 i = atoi(argv[1]); | |
26 | |
27 goto factorial(i); | |
28 } | |
29 |