Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Uebung5_5 {
- public static void main(String[] args) {
- char decode;
- char input = args[0].charAt(0);
- int position = Integer.parseInt(args[1]);
- if (position >26) {
- System.out.println("please enter a value between 0-26");
- System.exit(1);
- }
- if (input+position > 'Z') {
- decode = (char)(('A' + ( position - ('Z' - input )))-1);
- } else {
- decode = (char)(input+position);
- }
- System.out.println(input+" => "+decode);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement