// 小米智能手机的解锁初探;
#include<iostream>
using namespace std;
#include<windows.h>
int main()
{
string str;
int password=123456;
int password1;
int i=0;
cout<<"请输入密码:(密码必须是一个六位数)"<<endl;
while(cin>>password1)
{
if(password1==password)
{
cout<<"Entering..."<<endl;
break;
}
else
{
cout<<"Your password is wrong! Please input again.."<<endl;
i++;
if(i==3)
{
cout<<"你输入密码的次数已经超过3次,请30秒后再登陆.."<<endl;
for( int sc=30;sc>=0;sc--)
{
if(sc>=10)
{
cout<<sc;
Sleep(1000);
cout<<'\b'<<'\b';
}
//cout<<'\b'<<'\b';
if(sc<=9)
{
cout<<'0'<<sc;
Sleep(1000);
cout<<'\b'<<'\b';
}
}
cout<<endl;
}
if(i==6)
{
cout<<"你输入密码的次数已经超过6次,请60秒后再登陆.."<<endl;
for( int sc=60;sc>=0;sc--)
{
if(sc>=10)
{
cout<<sc;
Sleep(1000);
cout<<'\b'<<'\b';
}
//cout<<'\b'<<'\b';
if(sc<=9)
{
cout<<'0'<<sc;
Sleep(1000);
cout<<'\b'<<'\b';
}
} cout<<endl;
}
}
}
return 0;
#include<iostream>
using namespace std;
#include<windows.h>
int main()
{
string str;
int password=123456;
int password1;
int i=0;
cout<<"请输入密码:(密码必须是一个六位数)"<<endl;
while(cin>>password1)
{
if(password1==password)
{
cout<<"Entering..."<<endl;
break;
}
else
{
cout<<"Your password is wrong! Please input again.."<<endl;
i++;
if(i==3)
{
cout<<"你输入密码的次数已经超过3次,请30秒后再登陆.."<<endl;
for( int sc=30;sc>=0;sc--)
{
if(sc>=10)
{
cout<<sc;
Sleep(1000);
cout<<'\b'<<'\b';
}
//cout<<'\b'<<'\b';
if(sc<=9)
{
cout<<'0'<<sc;
Sleep(1000);
cout<<'\b'<<'\b';
}
}
cout<<endl;
}
if(i==6)
{
cout<<"你输入密码的次数已经超过6次,请60秒后再登陆.."<<endl;
for( int sc=60;sc>=0;sc--)
{
if(sc>=10)
{
cout<<sc;
Sleep(1000);
cout<<'\b'<<'\b';
}
//cout<<'\b'<<'\b';
if(sc<=9)
{
cout<<'0'<<sc;
Sleep(1000);
cout<<'\b'<<'\b';
}
} cout<<endl;
}
}
}
return 0;
}