// This is what I need to do
Take N (number of rows), print the following pattern (for N = 4)
0
1 1
2 3 5
8 13 21 34
//This is my code
#include
using namespace std;
int main() {
int N;
cin>>N;
int numberO = 0;
int numberZ = 1;
int numberX;
cout<<numberO<<endl<<numberZ<<" "<<numberZ<<endl;
for(int i = 2 ; i <=N-1; ++i){
for(int j = 0 ; j <=i ; ++j){
numberX = numberO+numberZ;
cout<<numberO+numberZ<<" ";
numberO = numberZ;
numberZ = numberX;
}
cout<<endl;
}
return 0;
}
can anyone help me withwhats wrong ?
just cant figure out why the test case wont pass