Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int n,col,i,j,aux;
- unsigned long long fil;
- scanf("%d",&n);
- col = n;
- aux = pow(2,n);
- fil = aux;
- int matriz[fil][col];
- for(i=0;i<fil;i++)
- {
- for(j=0;j<col;j++)
- {
- matriz[i][j]=0;
- }
- }
- for(i=0;i<fil;i++)
- {
- for(j=col-1;j>=0;j--)
- {
- if(i && 1)
- {
- matriz[i][j]=0;
- }
- else
- {
- matriz[i][j]=1;
- }
- }
- for(j=0;j<col;j++)
- {
- printf("%d",matriz[i][j]);
- }
- printf("\n");
- }
- /*for(i=0;i<fil;i++)
- {
- for(j=0;j<col;j++)
- {
- printf("%d",matriz[i][j]);
- }
- printf("\n");
- }*/
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement