A makefile and some random fixes
This commit is contained in:
parent
6f7482b9f3
commit
1c210b879d
7 changed files with 47 additions and 13 deletions
14
p11.c
14
p11.c
|
|
@ -20,6 +20,7 @@
|
|||
/* macro for checking all directions of a square x,y */
|
||||
#define check_square(x, y) \
|
||||
do { \
|
||||
int p; \
|
||||
if (x < 17) \
|
||||
setprod(px(x, y)); \
|
||||
if (y < 17) \
|
||||
|
|
@ -30,6 +31,13 @@
|
|||
setprod(prd(x, y)); \
|
||||
} while(0)
|
||||
|
||||
#define setprod(x) \
|
||||
do { \
|
||||
p = x; \
|
||||
if (p > result) \
|
||||
result = p; \
|
||||
} while(0)
|
||||
|
||||
int grid[20][20] = {
|
||||
{ 8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8 },
|
||||
{ 49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0 },
|
||||
|
|
@ -55,12 +63,6 @@ int grid[20][20] = {
|
|||
|
||||
unsigned int result = 0;
|
||||
|
||||
void inline setprod(int p) {
|
||||
|
||||
if (p > result)
|
||||
result = p;
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
int x, y;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue