fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int i,j,n;
  5. scanf("%d",&n);
  6. for(i=n;i>=1;i--){
  7. for(j=1;j<=i;j++){
  8. if(j%2==0){
  9. printf("1 ");
  10. }
  11. else{
  12. printf("0 ");
  13. }
  14. }
  15. printf("\n");
  16. }
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0.01s 5316KB
stdin
5
stdout
0 1 0 1 0 
0 1 0 1 
0 1 0 
0 1 
0