一个小小的手机密码系统
Posted bkzyp
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了一个小小的手机密码系统相关的知识,希望对你有一定的参考价值。
第一次写。
大神不喜勿喷。?(?ω?)?
#include<bits/stdc++.h>
using namespace std;
int main()
{
char o=0,a[6],b[6]={111,111,111,111,111,111};
if(b[4]==111)
{
cout<<"请设置手机密码"<<endl;
for(int i=1;i<=6;i++)
cin>>b[i];
cout<<"密码设置成功!"<<endl;
}
cout<<" ______________________________________ "<<endl;
cout<<" | | "<<endl;
cout<<" | 请输入手机密码 | "<<endl;//①这里凹进去是因为里面有中文,复制到编译器里是齐的。详情见下。
cout<<" | ······ | "<<endl;//②
cout<<" | | "<<endl;
cout<<" | ______ ______ ______ | "<<endl;
cout<<" | | | | | | | | "<<endl;
cout<<" | | 1 | | 2 | | 3 | | "<<endl;
cout<<" | |______| |______| |______| | "<<endl;
cout<<" | | "<<endl;
cout<<" | ______ ______ ______ | "<<endl;
cout<<" | | | | | | | | "<<endl;
cout<<" | | 4 | | 5 | | 6 | | "<<endl;
cout<<" | |______| |______| |______| | "<<endl;
cout<<" | | "<<endl;
cout<<" | ______ ______ ______ | "<<endl;
cout<<" | | | | | | | | "<<endl;
cout<<" | | 7 | | 8 | | 9 | | "<<endl;
cout<<" | |______| |______| |______| | "<<endl;
cout<<" | | "<<endl;
cout<<" | ______ | "<<endl;
cout<<" | | | | "<<endl;
cout<<" | | 0 | | "<<endl;
cout<<" | |______| | "<<endl;
cout<<" | | "<<endl;
cout<<" | | "<<endl;
cout<<" |______________________________________| "<<endl;
for(int j=1;j<=5;j++)
{
o=0;
for(int i=1;i<=6;i++)
{
cout<<endl;
cin>>a[i];
if(b[i]==a[i])
o++;
}
if(o==6)
{
cout<<"密码正确"<<endl;
break;
}
else
{
if(j==1||j==2||j==3)
{
cout<<"密码错误,请重新输入"<<endl;
}
if(j==4)
{
cout<<"密码错误,最后一次机会"<<endl;
}
if(j==5)
{
cout<<"密码错误,手机数据清空"<<endl;
}
}
if(o==6) break;
}
}
①中文在编译器中占两个字符位置,而在这里只占一个字符位置,所以会凹进去。
②同上。
注:可以复制
以上是关于一个小小的手机密码系统的主要内容,如果未能解决你的问题,请参考以下文章
无法通过使用 Volley 库中的 Intent 从片段中移动下一个 Activity
修改MySQL密码报错“ERROR 1819 (HY000): Your password does not satisfy the current policy requirements“(代码片段