Advertisement
kmahadev

Decode

Nov 23rd, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. import java.util.Arrays;
  2.  
  3.  
  4. public class Crypto {
  5.  
  6. public static void main(String[] args) {
  7. int index = 0;
  8. int fIndex = 0;
  9. char found;
  10. char[] ca = {' ','!','"','#','$','%','&','\'','(',')',
  11. '*','+',',','-','.','/','0','1','2','3','4','5',
  12. '6','7','8','9',':',';','<','=','>','_','@',
  13. 'A', 'B', 'C', 'D', 'E', 'F','G','H','I','J',
  14. 'K','L','M','N','O','P','Q','R','S','T','U',
  15. 'V','W','X','Y','Z','[','\\',']','^','_'};
  16.  
  17. char[][] input = { {'L','T','>','E','O','Q','W','S','T',
  18. 'G','V','C','H','E'},
  19. {'X','X','3','3','E','2','3','X',
  20. 'W','I','I','X','E','X' } };
  21. char [][] output = new char[2][14];
  22.  
  23. for(int i=0; i<2; i++) {
  24. for (int j=0; j<input[0].length; j++) {
  25. System.out.print(input[i][j]);
  26. //System.out.print(Arrays.toString(input));
  27. }
  28. System.out.println();
  29. }
  30.  
  31. for(int i=0; i<2; i++) {
  32. for (int j=0; j<input[i].length; j++) {
  33. //System.out.println(input[i][j]);
  34. for(int c=0; c < ca.length; c++) {
  35. if (input[i][j] == ca[c]){
  36. fIndex = c-4;
  37. output[i][j] = ca[fIndex];
  38. System.out.print(output[i][j]);
  39. }
  40. }
  41. }
  42. System.out.println();
  43. }
  44.  
  45. //System.out.println(num);
  46. // TODO Auto-generated method stub
  47.  
  48. }
  49.  
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement