public static void main(String[] args) {
int x, y=0;
for(x=1; x<5; x++) y+=x*x;
System.out.println("y="+y);
}

【A.】y=40
【B.】y=30
出自:国家开放大学面向对象程序设计