所以这是一个非常基本的代码:
public class Problem14 {
public static void main(String[] args) {
long sumOfSquares = 0;
long squareOfSums = 0;
for(int i = 0; i < 100; i++) {
sumOfSquares += (i * i);
}
for(int i = 0; i < 100; i++)
squareOfSums += i;
}
squareOfSums = squareOfSums * squareOfSums;
long diff = sumOfSquares - squareOfSums;
System.out.println(diff);
}
}
Problem14.java:13: error: <identifier> expected
squareOfSums = squareOfSums * squareOfSums;
^
Problem14.java:15: error: <identifier> expected
System.out.println(diff);
^
Problem14.java:15: error: <identifier> expected
System.out.println(diff);
^
Problem14.java:17: error: class, interface, or enum expected
}
^
4 errors
我不确定为什么会收到这些错误。这是一个非常基本的代码!
我无法调试,因为我收到我的代码没有主代码的错误!