import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner input = new Scanner(System.in); int num = -1; int score = 0; int prior = 0; //当输入0时 游戏结束 计算分数 while((num=input.nextInt())!=0){ if(num==1){ score = score+1;…