判断一个数(小于10位)的位数。为什是死循环了。求解!
public class TestForchenfa { public static void main(String[] args) { int num = 999; int count = 0; for(;num>=0&&num<=999999999;num++){ if(num!=0){ } count++; System.out.println("他是个"+count+"位数");} } }
public class TestForchenfa { public static void main(String[] args) { int num = 999; int count = 0; for(;num>=0&&num<=999999999;num++){ if(num!=0){ } count++; System.out.println("他是个"+count+"位数");} } }
2017-02-22
举报