-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest17373637.cpp
More file actions
34 lines (34 loc) · 866 Bytes
/
Copy pathtest17373637.cpp
File metadata and controls
34 lines (34 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <iostream>
#include <string>
using namespace std;
int main() {
string reguser, regpass, user, pass;
cout << "register" << endl;
cout << "user: ";
cin >> reguser;
cout << "pass: ";
cin >> regpass;
cout << "account registered!" << endl;
system("clear");
bool login = false;
int attempt = 0;
while (attempt < 3 && !login) {
cout << "login" << endl;
cout << "user: ";
cin >> user;
cout << "pass: ";
cin >> pass;
system("clear");
if (user == reguser && pass == regpass) {
cout << "login success!" << endl;
login = true;
} else {
cout << "wrong pass or user!" << endl;
attempt++;
}
}
if (attempt > 3 && !login) {
cout << "account locked after many attempt!";
}
return 0;
}