Created
February 23, 2023 02:35
-
-
Save kaline/ae7476e4be93067bbe8dbe005b5c7c08 to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
#define linha 6 | |
#define coluna 6 | |
int printMatrixInvertida(int mat[linha][coluna]){ | |
for(int i=0; i<linha;i++){ | |
for(int j=0;j<coluna;j++){ | |
if(i+j < linha-1){ | |
printf(" %d ", mat[i][j]); | |
} | |
else{ | |
printf(" * "); | |
} | |
} | |
printf("\n "); | |
} | |
} | |
int printMatrixInvertidaInferior(int mat[linha][coluna]){ | |
for(int i=0; i<linha;i++){ | |
for(int j=0;j<coluna;j++){ | |
if(i+j > linha-1){ | |
printf("%d ", mat[i][j]); | |
} | |
else{ | |
printf(" * "); | |
} | |
} | |
printf("\n "); | |
} | |
} | |
int main(){ | |
int mat[linha][coluna] = { | |
3,3,4,1,5,1, | |
6,0,5,5,6,6, | |
1,0,5,6,3,2, | |
8,9,6,7,9,9, | |
6,3,2,2,7,6, | |
9,1,6,6,0,9 | |
}; | |
printMatrixInvertida(mat); | |
printf("\n "); | |
printMatrixInvertidaInferior(mat); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment