Advertisement
realever15

Uva10222

May 26th, 2015
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class uva10222 {
  4.     static String keyboard = "1234567890-=qwertyuiop[]asdfghjkl;'zxcvbnm,./";
  5.     public static void main(String[] args) {
  6.         Scanner scn = new Scanner(System.in);
  7.         String input = scn.nextLine();
  8.         decode(input,input.length());
  9.     }
  10.     static void decode(String code,int len)
  11.     {
  12.         String print = "";
  13.         for(int i=0;i<len;i++)
  14.         {
  15.             if(code.charAt(i)==' ')
  16.             {
  17.                 print+=' ';
  18.             }
  19.             else
  20.             {
  21.                 for(int k=0;;k++)
  22.                 {
  23.                     if(code.charAt(i)==keyboard.charAt(k))
  24.                     {
  25.                         print+=keyboard.charAt(k-2);
  26.                         break;
  27.                     }
  28.                 }
  29.             }
  30.         }
  31.         System.out.println(print);
  32.     }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement