1
0
Fork 0
Project-Euler/C/15-giudoku.c
2012-04-05 05:32:56 -04:00

40 lines
No EOL
564 B
C
Executable file

#include <stdio.h>
#define LEN 21
void printMatrice(unsigned long long m[][LEN])
{
int i,j;
for (i = 0; i < LEN; ++i)
{
for (j = 0; j < LEN; ++j)
{
printf ("%11llu ", m[i][j]);
}
printf("\n");
}
}
int main(int argc, char **argv)
{
unsigned long long matrice[LEN][LEN] = {0};
int i, j;
for (i = 0; i < LEN; ++i)
{
matrice[i][0] = matrice[0][i] = 1;
}
matrice[0][0] = 0;
for (i = 1; i < LEN; ++i)
{
for (j = 1; j < LEN; ++j)
{
matrice[i][j] = matrice[i-1][j] + matrice[i][j-1];
}
}
printMatrice(matrice);
return 0;
}