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

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

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

正确输入:

错误输入:






使用sc.nextInt()输入实例

正确输入1:

正确输入2:

posted @ 2021-01-04 20:27  RealQ  阅读(320)  评论(0编辑  收藏  举报