Solution :
public class NewMain {
public_static void main_(String[] args) {
boolean[] _locker = new boolean_[101];
// to set all the locks to a false NOTE: first locker is the number 0. Last locker is the 99.
for (int_i=1;i<locker_length; i++)
{
locker[i] = false;
}
// first student opens all lockers.
for (int i=1;i<locker.length; i++) {
locker[i] = true;
}
for(int S=2; S<locker.length; S++)
{
for(int k=S; k<locker.length; k=k+S)
{
if(locker[k]==false) locker[k] = true;
else locker[k] = false;
}
}
for(int S=1; S<locker.length; S++)
{
if (locker[S] == true) {
System.out.println("Locker " + S + " Open");
}
/* else {
System.out.println("Locker " + S + " Close");
} */
}
}
}