使用scanner从键盘获取数据
//引用Scanner类
import java.util.Scanner;//引用Scanner类
class ScannerTest{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int num = scan.nextInt();
System.out.println(num);
}
}
2021-07-31 21:47:26
//引用Scanner类
import java.util.Scanner;//引用Scanner类
class ScannerTest{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int num = scan.nextInt();
System.out.println(num);
}
}