Last active
December 22, 2015 19:59
-
-
Save ahoulgrave/6523129 to your computer and use it in GitHub Desktop.
Matriz de 5x5...
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 <cstdlib> | |
#include <iostream> | |
using namespace std; | |
int main(int argc, char *argv[]) | |
{ | |
int m[5][5] = { | |
{1,2,3,4,5}, | |
{6,7,8,9,10}, | |
{11,12,13,14,15}, | |
{16,17,18,19,20}, | |
{21,22,23,24,25} | |
}; | |
for (int i = 0; i < 5; i++) { | |
for (int j = 0; j < 5; j++) { | |
if (j == 4-i || j == i) { | |
printf("%d",m[i][j]); | |
} else { | |
printf("0"); | |
} | |
printf("\t"); | |
} | |
printf("\n"); | |
} | |
system("PAUSE"); | |
return EXIT_SUCCESS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment