mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-29 10:32:47 +00:00
1e39a958c0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@906 91177308-0d34-0410-b5e6-96231b3b80d8
23 lines
363 B
C
23 lines
363 B
C
/* -*- mode: c -*-
|
|
* $Id$
|
|
* http://www.bagley.org/~doug/shootout/
|
|
*/
|
|
|
|
int atoi(char *);
|
|
void printf(char *, unsigned long);
|
|
|
|
unsigned long
|
|
fib(unsigned long n) {
|
|
if (n < 2)
|
|
return(1);
|
|
else
|
|
return(fib(n-2) + fib(n-1));
|
|
}
|
|
|
|
int
|
|
main(int argc, char *argv[]) {
|
|
int N = ((argc == 2) ? atoi(argv[1]) : 15);
|
|
printf("%ld\n", fib(N));
|
|
return(0);
|
|
}
|