Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to generate a simple password for C++

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how C++ generates simple passwords". In daily operation, I believe many people have doubts about how C++ generates simple passwords. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts about how C++ generates a simple password! Next, please follow the editor to study!

Topic description

Passwords are very important in our lives, and our secrets that we can't tell depend on it. Wow, ha ha. Next, Yuanzi needs to add a set of passwords to the password, which is simple but secure.

Assuming that Yuanzi's original password on a BBS is zvbo9441987, in order to facilitate his memory, he uses an algorithm to transform the password into YUANzhi1987. This password is his name and year of birth, which he can never forget, and can be brazenly placed in a conspicuous place without others knowing the real password.

He changes like this, and everyone knows the letters on the phone: 1 Murray 1, abc--2, def--3, ghi--4, jkl--5, mno--6, pqrs--7, tuv--8 wxyz--9,0--0. It's as simple as that. Yuanzi changes all the lowercase letters in the password into corresponding numbers, and the numbers and other symbols are not changed.

Disclaimer: there is no space in the password, while the uppercase letters in the password become lowercase and move back one bit, such as: X, first lowercase, and then move back one bit, it is y, it is simple. Remember, it's a when z moves back.

Enter description

The input includes multiple test data. Input is a clear text, the password length is not more than 100 characters, enter until the end of the file

Output description

Output Yuanzi's real ciphertext

Example

Input

YUANzhi1987

Output

Zvbo9441987

Analysis

Password conversion is actually the existence of a black box, we use this black box to convert plaintext passwords into actual required passwords. There may be a transformation formula in this black box, or it may just be a mapping with no mathematical relationship. It is easier to understand the follow-up questions of this problem. We only need to find the real password mapped by the plaintext password through one operation. Because the password rules and numbers are simple, we can directly generate a dictionary and then change the password like looking up a dictionary.

Code

# include

# include

Using namespace std

Const string dict1= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"

Const string dict2= "bcdefghijklmnopqrstuvwxyza22233344455566677778889999"

Char Char_Change (char a) {

For (int iTuno Bandi)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report