已采纳回答 / 慕瓜丶
(条件判断语句)条件判断>=:即大于或者等于,满足这俩个条件的其中一个即可例:X>=0,X可以是1,2,······N,0;<=:即小于或者等于,满足来个条件的其中一个即可例:X<=0,X可以是-1,-2,······-N,0
2020-06-05
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
//获取int类的长度首先转化为String类
String str=String.valueOf(num);
if(str.length()>0&&str.length()<10){
count=str.length();
System.out.println("它是个"+count+"位的数!");
}
else
System.out.println("输入有误!");
public static void main(String[] args){
int num = 999;
int count = 0;
//获取int类的长度首先转化为String类
String str=String.valueOf(num);
if(str.length()>0&&str.length()<10){
count=str.length();
System.out.println("它是个"+count+"位的数!");
}
else
System.out.println("输入有误!");