⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 password.bak

📁 Hotel Management System in c++
💻 BAK
字号:
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
void login()
{

 int attempt=1,curr_y=20,chrent=0;
 char password[]={"start"};
 char upass[7],chr;
 while(attempt<=3)
 {
  if(attempt>1)
   printf("\a");
  gotoxy(20,curr_y);
  cprintf("Enter your CURRENT password : ");
  while(chrent<=6)
  {
   chr=getch();
   if(chrent==6 && chr!=13)
   {
    if(chr==8)
    {
     printf("\b \b");
     chrent--;
     continue;
     }
    printf("\a");
    continue;
    }
   if(chr==13)
   {
    upass[chrent]='\0';
    if(strcmp(password,upass)==0)
    {
     gotoxy(30,10);
     cprintf("LOGIN SUCCESS ");
     return;
    }
    else
    {
     chrent=0;
     attempt++;
     curr_y++;
     break;
    }
   }
   if(chrent<6 && chrent>=0)
   {
    if(chr==8)
    {
     if(chrent>0)
     {
     printf("\b \b");
     chrent--;
     }
     else
      printf("\a");
     continue;
     }
    else
    {   upass[chrent++] = chr;
	printf("*");
    }
   }
  }  //while closed
 } // main while closed
 gotoxy(20,10);
 cprintf("LOGIN FAILED .... Press Any key to shut down");
 getch();
 exit(0);
 }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -