2016年7月2日 星期六

Q10222: Decode the Mad man


https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1163

import java.util.*;

public class Main {

 public static void main(String[] args) {
  Scanner scn=new Scanner(System.in);
  String arr="`1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./";
  char ary[]=arr.toCharArray();
  while(scn.hasNext()){
   String str=scn.nextLine().toLowerCase();
   char ary2[]=str.toCharArray();
   for(int i=0;i<ary2.length;i++){
    if(ary2[i]==' ')
     System.out.print(" ");
    else{
     for(int j=0;j<ary.length;j++)
      if(ary[j]==ary2[i])
       System.out.print(ary[j-2]);
    }
   }
   System.out.println();
  }

 }

 /* 
    題目:Q10222: Decode the Mad man
    作者:1010
    時間:西元 2016 年 7 月 */

}


困難度 
這題要注意的是鍵盤每一個英文字母還有數字還有每個下層符號 - = [ ] \ ; ' , . / 都要包含

沒有留言:

張貼留言