fix some file extensions
This commit is contained in:
parent
68f8f3e56b
commit
f3a896c724
789 changed files with 91 additions and 62 deletions
|
|
@ -1,3 +1,3 @@
|
|||
long long unsigned fib(unsigned n) {
|
||||
return n < 2 ? n : fib(n - 1) + fib(n - 2);
|
||||
long long int fibb(long long int a, long long int b, int n) {
|
||||
return (--n>0)?(fibb(b, a+b, n)):(a);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
long long unsigned fib(unsigned n) {
|
||||
long long unsigned last = 0, this = 1, new, i;
|
||||
if (n < 2) return n;
|
||||
for (i = 1 ; i < n ; ++i) {
|
||||
new = last + this;
|
||||
last = this;
|
||||
this = new;
|
||||
}
|
||||
return this;
|
||||
long long int fibb(int n) {
|
||||
int fnow = 0, fnext = 1, tempf;
|
||||
while(--n>0){
|
||||
tempf = fnow + fnext;
|
||||
fnow = fnext;
|
||||
fnext = tempf;
|
||||
}
|
||||
return fnow;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue