struct charic hunt(struct charic c, struct mon t)
  {   
 
  
      first:           
  system(\"cls\");
 
  int n; 
    if(c.lev>3)
   {  t.countlev=c.lev-3+random(6);
     
   }
       else if(c.lev<4)
    t.countlev=c.lev+random(3);
      
    t.countHP=t.countlev*30;
    t.countatk=t.countlev;
    t.countdff=t.countlev;
    
    printf(\"lev%d %s이 등장하였습니다\\n 싸우시려면 1 돌아가려면2를 입력해주세요\\n\", t.countlev, t.name[20]);
     scanf(\"%d\", &n);
   
   
      if(n==1)
     {
           while(c.Hp>=0 || t.countHP>=0)
              {
               printf(\"주인공 HP %d %s HP %d\\n\", c.Hp, t.countHP);   
               t.countHP=t.countHP-c.atk*2; 
               c.Hp=c.Hp-t.countatk*2;
               if(c.Hp<=0 || t.countHP<=0)
               break;
              }  
                
      }
   
     else if(n==2)
     goto act_end;
    
     else
     goto first;      
                
               
                if(c.Hp>t.countHP)
               {
                 int gain = t.countlev*100;
                 c.exp = c.exp+t.countlev*5;
                 c.cash = c.cash+t.countlev*100;
                 printf(\"승리\\n 경험치가 %d만큼 올랐습니다. %d골드를 획득하였습니다.\", t.countlev*5, gain);
                
                 system(\"pause\");
                  struct charic hunt={c.Expf, c.exp, c.lev, c.Mp, c.Hp, c.atk, c.dff, c.cash, c.elem};
                }
               
                if(c.Hp<t.countHP)
                {printf(\"패배\\n\");
                c.Hp=0;
               
                system(\"pause\");
              act_end:
                struct charic hunt={c.Expf, c.exp, c.lev, c.Mp, c.Hp, c.atk, c.dff, c.cash, c.elem}; 
                  }
                 
                 
                  return hunt;
      }