惊觉0
2016-12-01 10:53
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
for(;num>0;count++,num/=10);
System.out.println("它是个"+count+"位数!");
}
}输出:它是个3位的数!
题目告诉我结果不对……应该一样吧
myEclipse中运行正常,重新提交一下代码试试
Java入门第一季(IDEA工具)
1168383 学习 · 18754 问题
相似问题