码迷,mamicode.com
首页 > 其他好文 > 详细

使用Scanner从控制台获取两个数字

时间:2019-07-13 09:18:38      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:使用   tin   class   can   next   整数   stat   ext   第一个   

1     public static void main(String[] args) {        
2         Scanner s = new Scanner(System.in);
3         int a = s.nextInt();
4         System.out.println("第一个整数是:"+a);
5         int b = s.nextInt();
6         System.out.println("第一个整数是:"+b);
7     }

 

使用Scanner从控制台获取两个数字

标签:使用   tin   class   can   next   整数   stat   ext   第一个   

原文地址:https://www.cnblogs.com/fanful/p/11179353.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!