取余补零,switch case,简单易懂 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String str = scanner.nextLine(); int len = str.length(); // 8-取余 = 补零的长度 int zeroNum = 8- (len % 8); ...