If your platform supports a boolean type, it is better to use that, but an array of 100 integers if fine. Let's say 0 means the door is closed, and 1 means the door is open.

You first need to set all doors to closed

Then you loop through all students, and you let each student open the doors based on their number.

At the end you check which doors are still closed.

Just try to start with this, and post the code when you're stuck.

You first need to set all doors to closed

Then you loop through all students, and you let each student open the doors based on their number.

At the end you check which doors are still closed.

Just try to start with this, and post the code when you're stuck.