[Logo] Mendo Judge Discussion Board - Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
TEMA ZA FIBONACIEVI BROEVI  XML
Forum Index » Други задачи
Author Message
BATIR



Joined: 20/06/2015 16:36:50
Messages: 155
Online


jas ja resiv ovaa zadaca po moe zosto mi dava samo dva tocni odgovori?


#include <iostream>


using namespace std;

int main()
{
int n, i, sleden;
int prv=0;
int vtor=1;

cin>>n;

cout<<1<<endl;
for(i=1; i<n; i++)
{

sleden=prv+vtor;
prv=vtor;
vtor=sleden;

cout<<sleden<<endl;
}
return 0;
}
BATIR



Joined: 20/06/2015 16:36:50
Messages: 155
Online

ako moze da se prati pobrzo pomosta bidejki e bitno
lekov



Joined: 12/12/2014 11:52:12
Messages: 30
Offline

BATIR wrote:
jas ja resiv ovaa zadaca po moe zosto mi dava samo dva tocni odgovori?


#include <iostream>


using namespace std;

int main()
{
int n, i, sleden;
int prv=0;
int vtor=1;

cin>>n;

cout<<1<<endl;
for(i=1; i<n; i++)
{

sleden=prv+vtor;
prv=vtor;
vtor=sleden;

cout<<sleden<<endl;
}
return 0;
}


Ако збориш за оваа задача, тогаш треба да печатиш колку Фибоначиеви броеви има помеѓу p и k наместо да ги печатиш n-те Фибоначиеви броеви.

BATIR



Joined: 20/06/2015 16:36:50
Messages: 155
Online

fala!
 
Forum Index » Други задачи
Go to:   
Powered by JForum 2.1.8 © JForum Team