fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12.  
  13. String text, key;
  14. byte[] result = new byte[1000];
  15.  
  16. text = "12345678";
  17. key = "1 2 3 4 ";
  18.  
  19. for (int i = 0; i < text.length(); i++) {
  20. byte[] text_byte = text.getBytes();
  21. byte[] key_byte = key.getBytes();
  22.  
  23. result[i] = (byte) (text_byte[i] + key_byte[i]);
  24. String c_str = new String(result);
  25.  
  26. System.out.print(c_str);
  27. result[i] = 0;
  28. }
  29.  
  30. System.out.println();
  31. }
  32. }
Success #stdin #stdout 0.04s 4386816KB
stdin
Standard input is empty
stdout
bReThVkX