int score = 53;
// 变量保存加分次数
int count = 0;
System.out.println("加分前成绩:"+score);
//打印输出加分前成绩
if (score<60){
while(score<60){
score++;
count++;
}
} System.out.println("加分后成绩:"+score);
System.out.print("共加了"+count_+"次");
运行结果error: cannot find symbol
System.out.print("???"+count_+"?");
^
symbol: variable count_
location: class HelloWorld
1 error
System.out.print("共加了"+count_+"次");
这里count_多打了个_,去掉就好了。
System.out.print("共加了"+count+"次");