Problem: Contest Page | CodeChef
DIFFICULTY:
EASY.
PROBLEM:
The chef is trying to decode some pattern problems, Chef wants your help to code it. Chef has one number K to form a new pattern. Help the chef to code this pattern problem.
Program:
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--){
int n,x=0,y=1;
cin>>n;
for(int i=n;i>=1;i--){
for(int j=n;j>=i;j--){
cout<<x<<" ";
int temp=y;
y+=x;
x=temp;
}
cout<<endl;
}
}
}