forked from nanshan-high-school/20230223-quiz-basic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
41 lines (36 loc) · 843 Bytes
/
main.cpp
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
35
36
37
38
39
40
41
#include <iostream>
using namespace std;
int main() {
string mail, password;
int foul = 0;
int level = 0;
int level2 = 0;
int level3= 0;
int level4 = 0;
int level5 = 0;
cout << "輸帳號";
cin >> mail ;
if(mail[0] != 'a'){
foul++;
}
for(int i = 1; i<7 ; i++){
if(mail[i] <48|| mail[i]>57){
foul++;
}
if(mail[7] != '@'|| mail[8] != 'g'||mail[9] !='m'||mail[10] !='a'||mail[11] != 'i'||mail[12] != 'l'||mail[13] != '.'||mail[14] != 'c'||mail[15] != 'o'||mail[16] != 'm'){
foul++;
}
}if(foul == 0){
cout << "成功";
}
else if(foul!=0){
cout<< "失敗";
}
else{
cout <<"輸密碼";
cin >>password;
if(password.size() >= 8){
cout<<"ok";
}
}
}