Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Mines-problem! Please help!

blackout9000blackout9000 Posts: 4Member
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.