annotate test/fact0.c @ 6:bf602558130d

continuation
author kono
date Thu, 13 Jan 2000 13:41:09 +0900
parents d35df41eac69
children fdbf2fbc8140
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
1 #include "stdio.h"
d35df41eac69 Initial revision
kono
parents:
diff changeset
2
d35df41eac69 Initial revision
kono
parents:
diff changeset
3 main(ac,av)
d35df41eac69 Initial revision
kono
parents:
diff changeset
4 int ac;
d35df41eac69 Initial revision
kono
parents:
diff changeset
5 char *av[];
d35df41eac69 Initial revision
kono
parents:
diff changeset
6 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
7 printf("%d\n",fact(1,1,atoi(av[1])));
d35df41eac69 Initial revision
kono
parents:
diff changeset
8 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
9
d35df41eac69 Initial revision
kono
parents:
diff changeset
10 int
d35df41eac69 Initial revision
kono
parents:
diff changeset
11 fact(i,j,n)
d35df41eac69 Initial revision
kono
parents:
diff changeset
12 /*register*/ int i,j,n;
d35df41eac69 Initial revision
kono
parents:
diff changeset
13 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
14 if (i==n)
d35df41eac69 Initial revision
kono
parents:
diff changeset
15 return j;
d35df41eac69 Initial revision
kono
parents:
diff changeset
16 fact(i+1,j*i,n);
d35df41eac69 Initial revision
kono
parents:
diff changeset
17 }