Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- int main()
- {
- int x, z = 1,maior, q, y;
- while(1){
- scanf("%d", &x);
- if(x == 0)
- break;
- int M[x][x];
- maior = pow(2,(x-1))*pow(2,(x - 1));
- q = log10(maior)+1;
- y = q;
- for(int i=0; i<x; i++){
- for(int j=0; j<x; j++){
- M[i][j] = pow(2, i)*pow(2, j);
- printf("%*d",q - 1, M[i][j]);
- if (j != x - 1)
- printf(" ");
- }
- printf("\n");
- }
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement