Go Back   Champions of Regnum > Español > La Taberna

La Taberna Un lugar para conversar sobre casi cualquier tema

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 05-07-2008, 10:32 AM   #28
sunos
Count
 
sunos's Avatar
 
Join Date: Jan 2007
Location: Rosario
Posts: 1,440
sunos has a spectacular aura aboutsunos has a spectacular aura about
Default

Quote:
Originally Posted by arlick
2178309

Code:
def fibo (num):
     if(num == 0):
             return 0
     if(num == 1):
             return 1
     else:
             return (fibo(num -1) + fibo(num -2))
sunos se hace un poco lento en numeros altos D
para que hiciste otro prog? o.0
3524578

Code:
#include <stdio.h>
int fibo(a)
{
        if (a==0){return 0;}
        if (a==1){return 1;}
        else
        {
                return (fibo(a-1)+fibo(a-2));
        }
}
int main()
{
        int a;
        a=1;
        while(a<40)
        {
        printf("%d ,%d \n", fibo(a),a);
        a++;
        }
        return 0;
}
me cago en iso c99 que no me deja usar un for en el main >.<
__________________
Usuario GNU/linux registrado Nº450915
"Sólo hay un problema con el sentido común: que no es demasiado común" -- Milt Bryce
sunos no ha iniciado sesión   Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:33 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
NGD Studios 2002-2024 © All rights reserved