fork download
  1. #include<stdio.h>
  2.  
  3. int main(){
  4. int a;
  5. scanf("%d", &a);
  6. int u= a*(a+1)/2;
  7. int am=1;
  8. int em=0;
  9. printf("1 \n");
  10. for(int i=2; i<=a; i++){
  11.  
  12. for(int j=1; j<=i; j++){
  13. printf("%d ", am+em);
  14. int temp=am+em;
  15. em=am;
  16. am=temp;
  17.  
  18. }
  19.  
  20.  
  21. printf("\n");
  22. }
  23.  
  24.  
  25. }
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
1