【测开面试题-004】java实现1234按位输出1-2-3-4
package com.course.coke.exam; import java.util.Scanner; public class Demo02 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("请输入正整数:"); int num = scanner.nextInt(); rePrint(num); } static void rePrint(int num){ if (num > 9){ rePrint( num / 10); } System.out.println(num % 10 + " "); } }
---------------------------------------------------
立足软件测试领域,并重新定义测试!
---------------------------------------------------