如题,即是问JAVA里有没有相当于C里scanf或C++里cin的东西?
------解决方案--------------------
Scanner sc = new Scanner(System.in);
int i = sc.nextInt();
float f = sc.nextfloat();
------解决方案--------------------
import java.util.*;
public class Test {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int i = sc.nextInt();
System.out.println(i);
float f = sc.nextFloat();
System.out.println(f);
}
}