Old .gitignore actually prevent the kraken versions of the benchmarks from being comitted, scarily enough - also some of the c fib tests
This commit is contained in:
14
fib_test/fib.c
Normal file
14
fib_test/fib.c
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
int fib(n) {
|
||||
if (n == 0) {
|
||||
return 1;
|
||||
} else if (n == 1) {
|
||||
return 1;
|
||||
} else {
|
||||
return fib(n-1) + fib(n-2);
|
||||
}
|
||||
}
|
||||
int main(int argc, char **argv) {
|
||||
printf("%d\n", fib(atoi(argv[1])));
|
||||
return 0;
|
||||
}
|
||||
16
fib_test/fib_let.c
Normal file
16
fib_test/fib_let.c
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
int fib(n) {
|
||||
if (n == 0) {
|
||||
return 1;
|
||||
} else if (n == 1) {
|
||||
return 1;
|
||||
} else {
|
||||
int r1 = fib(n-1);
|
||||
int r2 = fib(n-2);
|
||||
return r1 + r2;
|
||||
}
|
||||
}
|
||||
int main(int argc, char **argv) {
|
||||
printf("%d\n", fib(atoi(argv[1])));
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user