Hello!!
I realy need some help!! :sad: :cry:
With Fibonacci numbers :(
I found some programes, and they are a lot of help :cheesy: but... I need some more help :rolleyes:
#include <iostream>
#include <conio.h>
using namespace std;
int main ()
{
int a[128];
int fN;
int i;
a[0]=1;
a[1]=1;
cout << "How many numbers do you want to add: ";
cin >> i;
for ( fN = 2 ; fN <= i ; fN++ )
{
a[fN]=a[fN-1]+a[fN-2];
cout << a[fN] <<"\n";
}
getch();
}
The program outcome is:
How many numbers do you want to add: 20
2
3
5
8
13
21
34
55
89
144
233
377
610
987
1597
2584
4181
6765
10946
This is grate :mrgreen: but... i need something more! ;)
I need the programe outcome to be something like this:
How many numbers do you want to add: 20
How many elements in a number you want to output: 3
144
233
377
610
987
The program sould output all numbers that have 3 elements.
Ofcors if I enter 4 in "How many elements in a number you want to output:" The program sould output numbers that have 4 elements (for example 10946 atc.)
I hope you will understand me :confused: .... I`m not realy good in spelling... :sad:
Help me please ;) :o