#P1665. 2024.1.30-后端开发机试-第二题

2024.1.30-后端开发机试-第二题

As an intern at Amazon, you have been assigned a task to implement the sign-in pages inthe Amazon Dummy Website. There are three sign-in pages, each with its own APl:

Register Login Logout
Function Registers a newuser with the username and password Verifies the username and password, then grants or denies access username logs out of the website
API Request register <username> <password> login <username> <password> logout <username>
Returns 1.lf the registrationwas successful,Registered Successfully 2.lf the user
already exists,Username
already exists
1.lf the login was successful, Logged In Successfully
2.If the login was
unsuccessful,Login
Unsuccessful
lf the logout was successful, Logged Out
Successfully
lf the given
username wasn't logged in, Logout
Unsuccessful

Given a log of APl requests, return the list of returns from the mock website.