瀏覽代碼

competed encrypt

mpierse 7 年之前
父節點
當前提交
82dd308098
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. 2
    2
      Crypto/src/ROT13.java

+ 2
- 2
Crypto/src/ROT13.java 查看文件

@@ -29,13 +29,13 @@ public class ROT13  {
29 29
         for(int i=0; i<text.length(); i++){
30 30
             isUppercase = Character.isUpperCase(text.charAt(i));
31 31
             int temp = Character.toLowerCase(text.charAt(i));
32
-            if (temp==32){
32
+            if (temp<97|temp>122){
33 33
             } else if(temp+rotator < 122){
34 34
             temp = (int)text.charAt(i)+rotator;
35 35
             } else {
36 36
                 temp = 96 + ((temp+rotator)-122);
37 37
             }
38
-            if(isUppercase){Character.toUpperCase(temp);}
38
+            if(isUppercase){temp=Character.toUpperCase(temp);}
39 39
             result+= (char)temp;
40 40
         }
41 41
         return result;