QQ account application and login-(string operation), account string

Source: Internet
Author: User

QQ account application and login-(string operation), account string
Question:

Provides a simplified version of QQ new account application and old account login. The biggest challenge is that the current QQ number already has 10 digits.

Input Format:

The input first gives a positive integer N (≤ 10 ^ 5), followed by N lines of instructions. The format of each line of command is: "command character (Space) QQ number (Space) password ". When the command line is "N" (New), it indicates that you want to apply for a New QQ number, followed by the number and password of the New account, and the command line is "L" (Login) the logon information is followed by the logon information of the old account. The QQ number is an integer with no more than 10 digits but greater than 1000 (it is said that the QQ boss's number is 1001. The password is a string containing no less than 6 characters, no more than 16 characters, and no space.

Output Format:

Provide the following information for each command:

1) if the New account is successfully applied, "New: OK" is output ";
2) if the new application number already exists, "ERROR: Exist" is output ";
3) if the old account is successfully logged in, "Login: OK" is output ";
4) if the QQ number of the old account does Not Exist, "ERROR: Not Exist" is output ";
5) if the old account password is incorrect, "ERROR: Wrong PW" is output ".

Input example:
5L 1234567890 myQQ@qq.comN 1234567890 myQQ@qq.comN 1234567890 myQQ@qq.comL 1234567890 myQQ @ qqL 1234567890 myQQ@qq.com
Output example:
ERROR: Not ExistNew: OKERROR: ExistERROR: Wrong PWLogin: OK

 

The C language causes a lot of losses to the question of a string. to query a table with a slightly complex ing Class, you can only use a linked list. In the competition, the hand-held linked list is the most time-consuming, in addition, debugging fails with a high probability.

C ++ is much better for string friends. The following uses C ++ map to do this.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.