/***************************************************************
* Bank Get All Users Number
****************************************************************/
int main(int argc, char**argv)
{
    char virtkey = 0;
    
	  Bank_Sys_Init();
	      	
	  for(;;)
	  {
        scanf("%c", &virtkey); 
        
        switch(virtkey)
        {
        	   case 'g'://进队
        	     break;
        	     
        	   case 'c'://出队
        	     break;
        	     
        	   case 'u'://总人数
        	     break;
        	     
        	   case 'e':
	                goto BSYSEXIT;
        	     break;        	     
        	   
        	   default:     	   	   
        	   	   if(virtkey != 10) // "ENTER" Key Code (10)
        	   	   {
        	           printf("Error Enter Key!! \n");
        	       }
        	     break;
        }
	  }
	  
BSYSEXIT:
	  Bank_Sys_Term();
	  
    return 0;
}
Exemple #2
0
/***************************************************************
* Bank Get All Users Number
****************************************************************/
int main(int argc, char**argv)
{
 	char virtkey = 0;
	int a = 0,b = 0;
	int tags = 0;
        int c;
	Bank_Sys_Init();
	      	
	for(;;)
	{
        scanf("%c", &virtkey); 
        
        switch(virtkey)
        {
        	   case 'g':
			printf("请输入你的身份:");
			scanf("%d",&c);
			switch(c){
				case 1:
					Bank_Sys_Get_Id1(a);
					a++;
					tags = 1;
					if(Bank_Get_User_Num1() == 0)
					a = a;
					break;
				case 2:
					Bank_Sys_Get_Id(b);
					b++;
					if(Bank_Get_User_Num() == 0)
					b = b;					
					break;	
				default:
					//printf("输入错误,请重新输入\n");
					break;
			}
        	     break;
        	     
        	   case 'c'://叫号
			if(1 == tags){
				printf("\nvip\t");
				Bank_Sys_Call_Id1();
				if(Bank_Get_User_Num1() == 0)
					{tags = 0;}			
			}
			else{
			printf("\n普通客户\t");
			Bank_Sys_Call_Id();
			}
        	     break;
        	     
        	   case 'u'://显示所有用户的数量
			printf("普通客户的当前数量为%d:\n",Bank_Get_User_Num());
			printf("vip客户的当前数量为%d:\n",Bank_Get_User_Num1());			

        	     break;
        	     
        	   case 'e':
	                goto BSYSEXIT;
        	     break;        	     
        	   
        	   default:     	   	   
        	   	   if(virtkey != 10) // "ENTER" Key Code (10)
        	   	   {
        	           printf("Error Enter Key!! \n");
        	       }
        	     break;
        }
	}
	  
BSYSEXIT:
	  Bank_Sys_Term();
	  
    return 0;
}