Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

950054 33902 #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions 950054 20230223/950054.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <iostream>
using namespace std;

int main() {
string gmail;
cin >> gmail;

if (gmail[0] == 'a' && gmail[7] == '@' && gmail[8] == 'g' &&
gmail[9] == 'm' && gmail[10] == 'a' && gmail[11] == 'i' &&
gmail[12] == 'l' && gmail[13] == '.' && gmail[14] == 'c' &&
gmail[15] == 'o' && gmail[16] == 'm' && gmail[1] <= '9' &&
gmail[2] <= '9' && gmail[3] <= '9' && gmail[4] <= '9' &&
gmail[5] <= '9' && gmail[6] <= '9' && gmail[1] >= '0' &&
gmail[2] >= '0' && gmail[3] >= '0' && gmail[4] >= '0' &&
gmail[5] >= '0' && gmail[6] >= '0'){
cout << "帳號有效";
} else {
cout << "帳號無效";}

string password;
cin >> password;
if (password.length()>=8){
cout << "密碼有效";
}else{
cout << "密碼無效";
}
}