新手问题1--Scanner(System.in).nextInt()与sc.nextInt()

针对于以上方法直接上代码,效果如下图:

使用Scanner(System.in).nextInt()输入实例:

正确输入:

错误输入:






使用sc.nextInt()输入实例

正确输入1:

正确输入2:

原文地址:https://www.cnblogs.com/RealQ/p/14232046.html