-
-
Save anonymous/ba53e46aaf35e2857ab4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
unsigned char N, M, I = 4, A, B, Maior[20] = {0}; | |
unsigned long long int V[20][20]; | |
int main(){ | |
scanf("%hhd", &N); | |
for(; N > 0; N--){ | |
scanf("%hhd", &M); | |
for(A = 0; A < M; A++){ | |
for(B = 0; B < M; B++){ | |
scanf("%llu", &V[A][B]); | |
V[A][B] *= V[A][B]; | |
if(V[Maior[B]][B] < V[A][B]) Maior[B] = A; | |
} | |
} | |
for(A = 0; A < M; A++) | |
Maior[A] = V[Maior[A]][A] > 0 ? (int) log10 ((double) V[Maior[A]][A]) + 1 : 1; | |
printf("Quadrado da matriz #%hhd:\n", I++); | |
for(A = 0; A < M; A++){ | |
for(B = 0; B < M; B++){ | |
printf("%*llu", (int)Maior[B], V[A][B] ); | |
if(B < M - 1) | |
printf(" "); | |
} | |
printf("\n"); | |
} | |
if(N > 1) | |
printf("\n"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment