import java.util.Scanner; import java.util.InputMismatchException; Class Sum{ public static void main(String[] args) throws Exception{ Scanner s = new Scanner(System.in); int sum = 0; int input; System.out.println("请输入一个整数"); while(true){ try { input = s.nextInt(); if (input == 0) break;