Skip to content

Like many others, Mr. Baker has way too many credit cards, each with its own 3-digit code on the back of the card. Since Mr. Baker is forgetful, he chooses to carefully record the 3-digit codes in the Notes app on his iPhone. Of course, he is smart enough not to write the real combination, and has devised a simple coding scheme that translates t…

Notifications You must be signed in to change notification settings

Hasteerp/PasswordDecipher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

PasswordDecipher

Like many others, Mr. Baker has way too many credit cards, each with its own 3-digit code on the back of the card. Since Mr. Baker is forgetful, he chooses to carefully record the 3-digit codes in the Notes app on his iPhone. Of course, he is smart enough not to write the real combination, and has devised a simple coding scheme that translates the 3-digit code into an encrypted one, by swapping the first and the third digit of the code, and replacing second digit by its 9’s complement. A code of the form abc is therefore encoded as c(9-b)a. For example, if the real 3-digit code is 250, the encrypted code willbe 042. A nice feature in his coding scheme is that he can apply the same scheme again on the encrypted code to calculate the real one. In this part, you will need to write a C program to help Mr. Baker. The program asks the user to enter an encrypted 3-digit code and then prints the real 3-digit code.

About

Like many others, Mr. Baker has way too many credit cards, each with its own 3-digit code on the back of the card. Since Mr. Baker is forgetful, he chooses to carefully record the 3-digit codes in the Notes app on his iPhone. Of course, he is smart enough not to write the real combination, and has devised a simple coding scheme that translates t…

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published