HBC223709[NOIP1999]旅行家的预算,贪心,NOIP复赛SoftPasswords题解

初见你 算法基础篇 43 0
想要检验自己的编程水平?来试试全网最全C++题库,让您在挑战中不断进步。
Your favourite social media website is changing their policy on login password validation: a slight error when logging in is now acceptable!In particular, assuming the password you chose when creating the account is S, a password P entered while logging in will be accepted if any of the following conditions are met: P and S are identical; S can be formed from P by prepending a single digit (0–9); S can be formed from P by appending a single digit; S is equal to P after reversing the case of all letters in P. To reverse the case of a string, replace all uppercase letters with their equivalent lowercase letters, and all lowercase letters with their equivalent uppercase letters, while leaving all other characters the same. For example, the case-reversal of pa55WORD is PA55word. Any other attempted password P will be rejected. So for example, if S is c0deninja5, then c0deninja will be accepted, but not C0deninja5 or c0deninja51. Write a program which, given alphanumeric strings S and P, determines whether P should be accepted.

Your favourite social media website is changing their policy on login password validation: a slight error when logging in is now acceptable! In particular, assuming the password you chose when creating the account is S, a password P entered while logging in will be accepted if any of the following conditions are met: P and S are identical; S can be formed from P by prepending a single digit (0–9);  S can be formed from P by appending a single digit;  S is equal to P after reversing the case of all letters in P. To reverse the case of a string, replace all uppercase letters with their equivalent lowercase letters, and all lowercase letters with their equivalent uppercase letters, while leaving all other characters the same. For example, the case-reversal of pa55WORD is PA55word. Any other attempted password P will be rejected. So for example, if S is c0deninja5, then c0deninja will be accepted, but not C0deninja5 or c0deninja51. Write a program which, given alphanumeric strings S and P, determines whether P should be accepted. 

HBC223709[NOIP1999]旅行家的预算,贪心,NOIP复赛SoftPasswords题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
不断挑战自我,才能突破极限!全网最全C++题库,让您在编程道路上越走越远。

标签: HBC223709[NOIP1999]旅行家的预算 贪心 NOIP复赛SoftPasswords题解