이 간단한 암호화 프로그램을 만들려고 노력했지만 몇 가지 사항을 파악할 수 없습니다. 내가 입력해야 문구는 문자열을정규 표현식을 사용하여 부분 문자열 바꾸기
This is a ag',rery dug>?/ijeb..w ssadorninjeb..w
를 반환하지만 내가 대신 내가 돌아를 입력하면
This is a very big morning.
이다 나는 왜, 어떻게 해결하는 방법을 이해하지 않습니다
This is a ajedg>P/..w',rery dg>P/ijedg>P/..w ssadorninjedg>P/..w
그것? 나는 지금도 약 1 개월 동안 자바를 배웠다. 그래도 나는 여전히 신선하다. 비슷한 질문이 있으면 이미 거기에 링크 해주세요. 그러면이 글을 삭제할 것입니다. 당신은 '당신은 모든 b
의 가져 오기'상기 g
교체에서의도 b
교체 교체 할 때 당신은 g
의 교체를 대체
import static java.lang.System.out;
import java.util.Scanner;
class Encryption {
public static void main(String[] args) {
Scanner userInput = new Scanner(System.in);
Crypto user1 = new Crypto();
out.print("Please enter in a sentence: ");
String user = userInput.nextLine();
user1.encrypt(user);
out.print(user1.getEncrypt());
}
}
public Crypto() { }
public String myEn;
public void encrypt(String Sentence) {
myEn = Sentence.replaceAll("v","ag',r")
.replaceAll("m" , "ssad")
.replaceAll("g" , "jeb..w")
.replaceAll("b" , "dg>P/");
}
public String getEncrypt() {
return myEn;
}
}