Scanner in =new Scanner(System.in); // int接收输入 int i = in.nextInt(); System.out.println(i); // float接收输入 float b =in.nextFloat(); System.out.println(b); // double接收输入 double c = in.nextDouble(); System.out.println(c); //单数组接收输入 String d = in.nextLine(); char [] liangzhanhao = d.toCharArray(); for(int i=0;i<liangzhanhao.length;i++){ System.out.print(liangzhanhao[i]+" "); }
【java篇-1】接收输入
最新推荐文章于 2024-08-24 22:01:16 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)