(大寫的N的值對應方格的邊長,下面的代碼N=5即是5*5的方格)
#include <fstream> N = , n = N + , m = n + way[] = { wpp( ++ ( way[ lev ] == = + path( grid[][] , i , j , ( dir == ) ++ ( dir == ) ++ ( dir == ) -- -- ( grid[i][j] ) ( i == n && j === = i = , j = grid[][] = { ( a = ; a != m ; ++][a] = -][a] = ] = -] = = bit = ( ; ! way[ bit ] ; -- , way[ bit-- ( bit != ) printf( , way[ bit--