不懂,求大神
这个需要用循环的吧 if只是用来判断 判断了score小于60所以else里的输出就不会执行了 用for循环可以实现 (刚学,说错了请不要介意)
public class d3 {
public static void main(String[] args) {
int a = 53;
int b = 0;
System.out.println("加分前:" +a);
for (int i = a;i<60;i++){
a++;
b++;
}
System.out.println("加分后:" +a);
System.out.println("次数:" +b);
}
}