用c++编写一个简单的用户登录程序
#include #include using namespace std;const string map[3][2] = { "user1", "123455", "user2", "asdfasdf", "root", "password" };int main(){ string name,pw; int i; while(cin >> name >> pw) { for(i = 0; i < 3; i ++) { if(map[i][0] == name)break; } if(i == 3) cout << "no such user name\n"; else if(map[i][1] != pw) cout << "password error\n"; else break; } cout << "Login ok, welcome "<< name << endl; cout << "no function, logout and exit\n"; return 0;}
用户登录html代码有哪些?
注册网页内容