Advertisement
S_h_u_v_r_o

1557

Nov 5th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include<stdio.h>
  2. int main() //all ok except space problem.
  3. {
  4. int a,b,c=1,d=1,n,m=0;
  5. while(1)
  6. {
  7. scanf("%d",&n);
  8. if(n==0)
  9. break;
  10. int x[n][n];
  11. for(a=0; a<n; a++)
  12. {
  13. m++;
  14. for(b=0; b<n; b++)
  15. {
  16. x[a][b]=c;
  17. c+=c;
  18. }
  19. d=d*2;
  20. c=d;
  21. if(n==m){c=1;d=1;m=0;}
  22. }
  23. for(a=0; a<n; a++)
  24. {
  25. for(b=0; b<n; b++)
  26. {
  27. printf("%d",x[a][b]);//problem...
  28. }
  29. printf("\n\n");
  30. }
  31. }
  32.  
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement