c++高手进来 急急急 !!!!给分多 菜鸟问题

来源:百度知道 编辑:UC知道 时间:2024/06/08 06:32:07
给我编写一个简易的登入程序 用c++写的 程序不要太复杂 我是初学者 如果能在一个小时之内答复给多20分
对了 三次以上就推出 账号密码直接写在程序里就可以了 这个是控制台程序

#include <iostream>
#include <string>
using namespace std;

int main()
{
string strUserName,strPassWord;
static int count=0;
while(count++<3)
{
cout<<"请输入账号:";
cin>>strUserName;
cout<<"请输入密码:";
cin>>strPassWord;
if("zhanghao" != strUserName)
{
cout<<"账号错误!"<<endl;
continue;
}
if("mima" != strPassWord)
{
cout<<"密码错误!"<<endl;
continue;
}
cout<<"信息正确。";
break;
}
return 0;
}

#include "iostream.h"
void main()
{
char *password = new char[]; //用来存储密码
int index =0; //用来当计数器,大于3就退出。
for (;;)
{
cin>>password;
if(index>3)
{
cout<<"错误次数