#include using namespace std; const int MAX = 10; char labirinth[MAX][MAX]; int n, m; // n- реда // m- стълба void inputLab() { cin>> n; cin>> m; for ( int i=0; i> labirinth[i][j]; } void printLab() { for ( int i=0; i= m || x >= n) return false ; if( labirinth[x][y] == 'e') return true; labirinth[x][y] = '*'; // надолу if( isFree( labirinth[x+1][y]) && findPath( x+1, y)) return true; // нагоре if( isFree( labirinth[x-1][y]) && findPath( x-1, y)) return true; // наляво if( isFree( labirinth[x][y-1]) && findPath( x, y-1)) return true; // надясно if( isFree( labirinth[x][y+1]) && findPath( x, y+1)) return true; return false ; } void solveLab() { inputLab(); int x, y; findStart(x , y); if(findPath( x , y)) { cout<<"There is path\n"; labirinth[x][y] = 's'; printLab(); } else cout<<"No path"<< endl; } int main() { solveLab(); return 0; }