public class HelloWorld {
public static void main(String[] args) {
int score = 58;
int count = 0;
System.out.println("加分前成绩:"+score);
if(score<60)
{
while(score!=60)
{
count++;
score=score+count;
}
System.out.println("加分后成绩:"+score);
System.out.println("共加了:"+count+"次!");
}
else{
System.out.println("不用加");
}
后面的大括号少了两
score=score+count; 换成 score++; 就OK了