Mercurial > hg > Papers > 2011 > nobu-prosym
view Paper/source/factorial.cbc @ 43:167208d58435
add graph.pdf
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Nov 2011 22:37:06 +0900 |
parents | 9adf0d4a6033 |
children | db63cc25d890 |
line wrap: on
line source
__code print_factorial(int prod) { printf("factorial = %d\n",prod); exit(0); } __code factorial0(int prod, int x) { if ( x >= 1) { goto factorial0(prod*x, x-1); }else{ goto print_factorial(prod); } } __code factorial(int x) { goto factorial0(1, x); }