Skip to content

Commit

Permalink
B_11655
Browse files Browse the repository at this point in the history
  • Loading branch information
likppi10 committed Oct 27, 2021
1 parent 0ce45a4 commit 4fad722
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Algorithm_Baek/Basic/B_203/B_11655_ROT13.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package B_203_자료구조1참고;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class B_11655_ROT13 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();

String mun = br.readLine();
char[] cA = mun.toCharArray();

for(int i=0; i<cA.length; i++) {
if(cA[i]>='a' && cA[i]<='z'){
char x = (char) (cA[i]+13);
if(x>'z') x -= 26;
sb.append(x);
}else if(cA[i]>='A' && cA[i]<='Z'){
char x = (char) (cA[i]+13);
if(x>'Z') x -= 26;
sb.append(x);
}else {
sb.append(cA[i]);
}
}
System.out.println(sb);
}
}

0 comments on commit 4fad722

Please sign in to comment.