Monday 7 October 2013

Infosys Aspiration 2020 2013 college round question-1

// siddhu vydyabhushana // 13 comments

Alice and Bob are being held at Azkaban(Prison). They want to escape and join Dumbledore's Army.
Alice wants to tell Bob about the details of the plan but wants to keep their escape plan from Dementors(the guards).
So Alice encrypts the message before passing the chits to Bob's cell.
However Bob was careless and he disposed the chits in his cell's waste paper bin.
The clever Dementor found the chits but couldn't make out what they said.
So he hired a computer programmer to decode the message for him. Please help the Dementor to decypher the message.
The code key that Alice used for this simple coding is a one for one character substitution based upon a single arithmetic manipulation of the printable portion of the ASCII character set.

infosys aspirations 2020

INPUT
The Encrypted message in a single line. The maximum number of charaters in a message is 100.
(DO NOT PRINT ANY PROMPT MESSAGE TO ENTER THE ENCRYPTED MESSAGE.)

OUTPUT
The decrypted message in a single line. (Do not print any other message other than the decrypted message.)

SAMPLE INPUT 1
[YHUZMVYT'[V'HUPTHN\Z'MVYT3

SAMPLE OUTPUT 1
TRANSFORM TO ANIMAGUS FORM,

SAMPLE INPUT 2
HUK'LZJHWL'^OLU'[OL`'IYPUN'MVVK5

SAMPLE OUTPUT 2
AND ESCAPE WHEN THEY BRING FOOD.




Answer:



import java.io.*;
class decyph{
public static void main(String args[])throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
char c;
     String kal;
       kal=in.readLine();
        for(int i=0;i<kal.length();i++){
           c=(char) (kal.charAt(i)-7);
           System.out.print(c);
        }
        System.out.println();
 }
}

13 comments:

  1. That is it! You are currently sending SMS upgrades!woocommerce notifications On the off chance that you need to change settings and alter the SMS messages that are sent, keep perusing.

    ReplyDelete
  2. People usually say about web design vs web development.
    yarh..you're right...we have much difference between these term. Thanks for informative share!service web design

    ReplyDelete
  3. I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles.

    Android Training in Chennai

    ReplyDelete
  4. I must thank you for the efforts you have put in penning this site. I am hoping to check out the same high-grade content by you later on as well. In truth, your creative writing abilities has inspired me to get my own, personal blog now..

    Corporate Training in Chennai

    ReplyDelete
  5. This information is impressive; I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic..
    seo company in india
    Digital Marketing Company in india

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete