fork download
  1.  
  2. import java.io.*;
  3. import java.util.*;
  4.  
  5. class Test{
  6. public static void main(String args[]){
  7. Hashtable table = new Hashtable();
  8.  
  9. // 辞書追加
  10. table.put("pen", "ペン");
  11. table.put("apple", "リンゴ");
  12. table.put("hand", "手");
  13. table.put("summer", "夏");
  14.  
  15. // 引数がなければ終了
  16. if( args.length == 0 )
  17. System.exit(-1);
  18.  
  19. String str = (String)table.get(args[0]);
  20. if( str == null )
  21. System.out.println("そんな言葉は知りません");
  22. else
  23. System.out.println(str);
  24. }
  25. }
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
Runtime error #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
Standard output is empty