fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. int N;
  5. cin>>N;
  6. cout<<"0"<<endl;
  7. int i=2;
  8. int a=0,b=1,c;
  9. for(;i<=N;i++){
  10.  
  11. for(int j=1;j<=i;j++){
  12. c=a+b;
  13. cout<<c<<"\t";
  14. a=b;
  15. b=c;
  16. }
  17. cout<<endl;
  18. }
  19.  
  20.  
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 15240KB
stdin
5

stdout
0
1	2	
3	5	8	
13	21	34	55	
89	144	233	377	610