#include #include #include #include using namespace std; enum State { CLOSED = 0, OPEN = 1 }; const char* label( State s ) { switch( s ) { case CLOSED: return "CLOSED"; case OPEN: return "OPEN"; } }; void toggle_state( State* locker_states, int index ) { State s = locker_states[ index ]; switch( s ) { case CLOSED: locker_states[index]=OPEN; break; case OPEN: locker_states[index]=CLOSED; break; } } void print_locker_states( State* locker_states, int number_of_lockers ) { for( int i=1;i" << endl; } int main( int argc, char** argv ) { if( argc < 2 ) { usage( argv[0] ); return 0; } int number_of_lockers = atoi( argv[ 1 ] ) + 1; State* locker_states = new State[number_of_lockers]; cout<<"**** close all lockers *****"<