2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-26 06:48:04 +02:00

Tippfehler korrigiert; Beispiele hinzugefügt

This commit is contained in:
Martin Thoma 2014-03-16 19:00:22 +01:00
parent deea4832fe
commit 0a336199c5
8 changed files with 68 additions and 22 deletions

Binary file not shown.

View file

@ -0,0 +1,14 @@
int fib(int n) {
if (n < 0) {
return -1;
}
int fib[2] = {0, 1}, tmp;
for (; n > 0; n--) {
tmp = fib[1];
fib[1] = fib[0] + fib[1];
fib[0] = tmp;
}
return fib[0];
}