import java.util.Scanner; public class Jump { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int totalScore = 0; int preScore = 0; while(sc.hasNextInt()){ int flag = sc.nextInt(); int score = 0; if(flag == 0){ break; }e…