各位大佬,这样子不可以吗
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("不用加");
}