Skip to content

Instantly share code, notes, and snippets.

@ahoulgrave
Created August 14, 2013 13:41
Show Gist options
  • Save ahoulgrave/6231181 to your computer and use it in GitHub Desktop.
Save ahoulgrave/6231181 to your computer and use it in GitHub Desktop.
arrays
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int B[5][5] = {
{1,2,3,7,5},
{4,5,6,8,4},
{7,8,9,6,4},
{7,8,9,6,4},
{7,8,9,6,4}
};
int r = 4;
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 5; j++) {
if (j == r) {
printf("%d ",B[i][j]);
r = r - 1;
} else {
printf("@ ");
}
}
printf("\n\n");
}
system("PAUSE");
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment