Scanner xxx = new Scanner(System.in);

然后xxx对象调用下列方法(函数),读取用户在命令行输入的各种数据类型:
next.Byte(),nextDouble(),nextFloat,nextInt(),nextLine(),nextLong(),nextShot()

package p3;

import java.util.*;

public class p3 {

public static void main(String args[]){

    Scanner a=new Scanner(System.in);

    int b[];

    b = new int[5];

    for(int i=0;i<5;i++){

        b[i] = a.nextInt();

    }

    int l=5;

    while(l!=0){

        --l;

        System.out.printf("%d",b[l]);

    }

}

}

  

相关文章:

  • 2022-12-23
  • 2021-09-24
  • 2021-08-18
  • 2021-07-05
  • 2022-01-18
猜你喜欢
  • 2022-12-23
  • 2021-06-20
  • 2021-08-20
  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
相关资源
相似解决方案