简单的算法
public class HelloWorld{
public static void main(String[] args){
int num=999;
int count=1;
int data,i,j;
for(i=1;i<=10;i++)
{
count=count*10;
data=num-count;
if(data<0)
{break;}
}
System.out.println("它是个"+i+"位的数!");
}
}
public class HelloWorld{
public static void main(String[] args){
int num=999;
int count=1;
int data,i,j;
for(i=1;i<=10;i++)
{
count=count*10;
data=num-count;
if(data<0)
{break;}
}
System.out.println("它是个"+i+"位的数!");
}
}
2019-02-02
举报