|
|
1.1 root 1: c subroutine tst11
2: parameter(ntest=11)
3: c Calls
4:
5: integer ack
6: if ( ack(2,2) .ne. 7 ) call e(1,ntest)
7: if ( ack(3,3) .ne. 61 ) call e(2,ntest)
8: if ( ack(3,5) .ne. 253 ) call e(3,ntest)
9: if ( ack(2,100) .ne. 203 ) call e(4,ntest)
10: call fib0(10,i)
11: if ( i .ne. 55 ) call e(5,ntest)
12: call fib(15,i)
13: if ( i .ne. 610 ) call e(6,ntest)
14: call fib(20,i)
15: if ( i .ne. 6765 ) call e(7,ntest)
16: end
17:
18: integer function ack(m,n)
19: if ( m.eq.0 )goto 1
20: if ( n.eq.0 )goto 2
21: ack = ack(m-1,ack(m,n-1))
22: return
23: 1 ack = n+1
24: return
25: 2 ack = ack(m-1,1)
26: end
27:
28: subroutine fib0(a, b)
29: c Fibonacci nrs
30: integer a,b,f0,f1
31: f0=1
32: f1=1
33: i=2
34: entry fib(a, b)
35: do 4 j=i+1,a
36: b=f0+f1
37: f0=f1
38: f1=b
39: 4 continue
40: i=a
41: end
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.