import java.util.Scanner;public class HelloWorld { public static void main(String[] args){ Scanner input = new Scanner(System.in);/*创建Scanner对象*/ System.out.print("请输入成绩:"); int score = input.nextInt();/*获取用户输入*/ int count = 0;/*加分的次数*/ System.out.println("加分前的成绩:"+score);// 只要成绩小于60就执行循环 while(score < 60){ score++;/*每次循环成绩加一*/ count++;/*每次循环次数加一*/ } System.out.println("加分后的成绩:"+score); System.out.println("共加了"+count+"次"); }}