#include<iostream.h>
#include<conio.h>
const int MAIN_WIN=0;
const int WORK_WIN=1;
const int MESSAGE_WIN=2;
class WINDOW{
      public:
             WINDOW(int win_type)
             {
              count=count+1;
              type=win_type;
              switch(type){
                   case MAIN_WIN:cout<<"Open a main window."<<endl;break;
                   case WORK_WIN:cout<<"Open a working window."<<endl;break;
                   case MESSAGE_WIN:cout<<"Open a message window."<<endl;break;
                   default:cout<<"Open an unknow window."<<endl;break;
                   }
                   }
             ~WINDOW()
             {
              count=count-1;
              switch (type){
                     case  MAIN_WIN:cout<<"Close a main window."<<endl;break;
                     case  WORK_WIN:cout<<""<<endl;break; 
                     case  MESSAGE_WIN:cout<<"..."<<endl;break;  
                     default:cout<<"close noting."<<endl;break;
                     }
                     }
             int get_win()
             {
                 return count;
             }
 private:
         static int count;
         int type;
         };
         int WINDOW::count=0;
class SCREEN{
      public:
             SCREEN():main_win(MAIN_WIN),work_win(WORK_WIN)
             {
                cout<<"initialize the screen"<<endl;
                }
             ~SCREEN()
             {
                cout<<"clear the screen"<<endl;
                }
             int get_win()
             {
                 return main_win.get_win();
                 }
      private:
              WINDOW work_win;
              WINDOW main_win; 
};
int main()
{
    SCREEN screen;
    WINDOW msg_win(MESSAGE_WIN);
    cout<<"there are "<<screen.get_win()<<"windows on screen "<<endl;
    cout<<"there are "<<msg_win.get_win()<<"message windows "<<endl;
    getch();
    return 0;
}