mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-17 00:57:54 +00:00
8e4c716d8a
llvm-svn: 906
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);
|
|
}
|