Reorganize tests

This commit is contained in:
Jeehoon Kang
2020-04-23 23:07:23 +09:00
parent 073a65ae53
commit 7c53818f73
50 changed files with 3 additions and 4 deletions

22
examples/c/fib5.c Normal file
View File

@@ -0,0 +1,22 @@
int fibonacci(int n) {
int i = 0;
int t1 = 0, t2 = 1, next_term = 0;
if (n < 2) {
return n;
}
i = 1;
do {
next_term = t1 + t2;
t1 = t2;
t2 = next_term;
++i;
} while (i < n);
return t2;
}
int main() {
return fibonacci(9) == 34;
}