public static void main(String[] args) { int s = 105; int result = 0; while (s > 0) { int m = s % 10; result += m; s /= 10; } System.out.println(result); } } A.6.0 B.10.0 C.5.0 D.20.0
添加回答
举报
0/150
提交
取消