Mines-problem! Please help!

Hi! I need help about this task:
Before entering the minefield, you are given a matrix 'b' filled with integers where every b[i,j] of them stands for a number of mines around (not includig) the a[i,j] part of the minefield.
The matrix' are NxN where N is a given integer N>=5.
The task is to write matrix 'a' that represents the minefield (if there is a mine then '*' else 's') so you could cross the minefield safely.

example
Input:
5
2 3 4 3 1
3 4 5 4 3
1 3 5 4 3
1 1 2 2 3
0 0 1 1 1

Output:
s * * s s
s * * * s
* s s * *
s s s * s

I've been trying to solve it for days but I can't!
Please help!
Please use only pascal.
Thanks!!!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories