package Day3; public class Days03_Tast05 { public static void main(String[] args) { System.out.println("请输入一个三位数"); java.util.Scanner input = new java.util.Scanner(System.in); int a= input.nextInt(); int b1=a/100; int b2=(a%100)/10; int b3=a%10; int sum= b1+b2+b3; System.out.println("三个数的和 "+sum); } }
Java中求三位数三个数字的和
最新推荐文章于 2023-11-09 22:09:36 发布