Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main() //all ok except space problem.
- {
- int a,b,c=1,d=1,n,m=0;
- while(1)
- {
- scanf("%d",&n);
- if(n==0)
- break;
- int x[n][n];
- for(a=0; a<n; a++)
- {
- m++;
- for(b=0; b<n; b++)
- {
- x[a][b]=c;
- c+=c;
- }
- d=d*2;
- c=d;
- if(n==m){c=1;d=1;m=0;}
- }
- for(a=0; a<n; a++)
- {
- for(b=0; b<n; b++)
- {
- printf("%d",x[a][b]);//problem...
- }
- printf("\n\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement