import java.util.Scanner;
public class duochongxunhuan2 {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
System.out.println("请输入1~999999999之间的数字 ");
int t = in.nextInt();
int a = 0;
int b = 0;
if(a>=1&&a<=999999999){
while(a>=1){
a=a/10;
b++;
}
System.out.println("这是个"+(b-1)+"位数");
}else{
System.out.println("输入有误");
}
}
}
import java.util.Scanner;
public class duochongxunhuan2 {
public static void main(String[] args){
Scanner in=new Scanner (System.in);
System.out.println("请输入a的值:");
int a=in.nextInt();
int b = 0;
if(a>=1&&a<=999999999){
while(a>=1){
a=a/10;
b++;
}
System.out.println("这是个"+b+"位数");
}else{
System.out.println("输入有误");
}
}
}
对对对,终于搞好了 好难啊 哈哈哈哈
你的t没使用啊?