import java.util.Scanner;
public class EnemyMessage {
public static void main(String[] args) {
System.out.println("enter the code:");
Scanner keyboard = new Scanner(System.in);
int key;
int i;
String code = keyboard.next();
for (key = 1; key <= 100; key++) {
for (i = 0; i < code.length(); i--) {
char c = code.charAt(i);
int n = (int) c;
System.out.println(n);
{
(char) c = (int) c - 32 + key + 127;
System.out.println(c);
}
}
}
}
}
这段代码给了我两个对我来说没有多大意义的错误。据我所知,我没有做任何与我之前所做的不同的事情。
错误:
最佳答案
import java.util.Scanner;
public class EnemyMessage
{
public static void main (String[] args)
{
System.out.println("enter the code:");
Scanner keyboard = new Scanner (System.in);
int key;
int i;
String code = keyboard.next();
for (key = 1; key<=100; key++)
{
for ( i = 0; i < code.length(); i--)
{
char c = code.charAt(i);
int n = (int)c;
System.out.println(n);
{
c = (char)(c - 32 + key + 127);
System.out.println(c);
}
}
}
}
}
2)"{"预期意味着您缺少 {
1)错位的构造函数是因为你没有{
关于java - 需要有关编译器错误的帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21805331/