package liannxi;
import java.util.Scanner;
public class xunhuan {
public static void main(String[] orgc) {
Scanner scanner = new Scanner(System.in);
long a = scanner.nextLong();
int i;
if(a > 1000000000)
System.out.println("输入错误");
else
{for(i=0;(a>0);)
{a=a%10;
i++;
}
System.out.print(i);}
System.out.print(a);
}
}
运行后出现
Exception in thread "main" java.util.InputMismatchException
at java.base/java.util.Scanner.throwFor(Scanner.java:939)
at java.base/java.util.Scanner.next(Scanner.java:1594)
at java.base/java.util.Scanner.nextLong(Scanner.java:2373)
at java.base/java.util.Scanner.nextLong(Scanner.java:2328)
at liannxi/liannxi.xunhuan.main(xunhuan.java:8)
按照自己的节奏前行
相关分类