Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. int main()
  4. {
  5. int x, z = 1,maior, q, y;
  6. while(1){
  7. scanf("%d", &x);
  8. if(x == 0)
  9. break;
  10. int M[x][x];
  11. maior = pow(2,(x-1))*pow(2,(x - 1));
  12. q = log10(maior)+1;
  13. y = q;
  14. for(int i=0; i<x; i++){
  15. for(int j=0; j<x; j++){
  16. M[i][j] = pow(2, i)*pow(2, j);
  17. printf("%*d",q - 1, M[i][j]);
  18. if (j != x - 1)
  19. printf(" ");
  20. }
  21. printf("\n");
  22. }
  23. printf("\n");
  24. }
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement