-
-
Save anonymous/9afab04ee3c3506f65b1 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]; | |
inline void clear(){ | |
for(A = 0; A < M; A++) | |
Maior[A] ^= Maior[A]; | |
} | |
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] ); | |
} | |
printf("\n"); | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment