(String processing 4.7.13) POJ 2141 Message Decowding (string encryption and decryption & amp ;&

Source: Internet
Author: User

Package com. njupt. acm; import java. util. arrays; import java. util. extends; public class POJ_2141 {public static void main (String [] args) {extends = new loads (System. in); while (partial. hasNextLine () {String str = bytes. nextLine (); str = str. trim (); if (str. length () = 0) {break;} char keys [] = str. toCharArray (); // convert the key into an array. keys [0] = 'F' indicates that in this key, a corresponds to f String text = keys. nextLine (); text = text. trim (); int len = text. length (); int I; for (I = 0; I <len; ++ I) {// note Character. when isAlphabetic (codePoint) is submitted, OJ may not be able to recognize if (Character. isUpperCase (text. charAt (I) {// Character. isUpperCase (ch) is used to determine whether a character is an upper-case System. out. print (char) (keys [text. charAt (I)-'a']-'A' + 'A');} else if (Character. isLowerCase (text. charAt (I) {System. out. print (keys [text. charAt (I)-'a']);} else {System. out. print (text. charAt (I) ;}} System. out. println ();}}}

 

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.