-
-
Save ArthurLoboLobo/3f3761047adbd3ca393b09d45969f89e 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<bits/stdc++.h> | |
using namespace std; | |
int main() { | |
int A[3][3]; | |
//Leio a matriz | |
for(int i = 0; i < 3; i++) { | |
for(int j = 0; j < 3; j++) { | |
scanf("%d",&A[i][j]); | |
} | |
} | |
printf("Diagonal principal: %d",A[0][0]+A[1][1]+A[2][2]); | |
printf("Diagonal secundaria: %d",A[0][2]+A[1][1]+A[2][0]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment