public class Hello { public static void main(String args[]) { int sum = 0; for (int i = 1; i < 100; i++) { sum = sum + i * i; } System.out.println("1的平方+2的平方+3的平方+…+99的平方=" + sum); }}