下面是我的代碼,它打印J = 74,A = 65和M = 77。作爲字母下移的結果,我如何才能打印字符K,B,N?將ASCII碼轉換爲Java中的char
BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));
String string = JOptionPane.showInputDialog(" Please Enter Code ");
for (int i = 0; i < string.length(); ++i) {
char c = string.charAt(i);
int j = (int)c;
}
System.out.println("ASCII OF "+c +" = " + j + ".");
也許你的意思是'C++'? – Dunes
@Dunes yes ...;) –
21世紀的「真正的程序員」可以用任何語言編寫「C++」。 :-) –