1、数值录入
Scanner sc = new Scanner(System.in);
// System.out.println("Piease input x = ");
// double x = sc.nextDouble();
// System.out.println("Please input y = ");
// double y = sc.nextDouble();
// System.out.println("Please input z = ");
// double z = sc.nextDouble();
2、三值取大小
if(x > y){
if(x > z)
System.out.println("max = " + x);
else
System.out.println("max = " + z);
}
else{
if(y > z)
System.out.println("max = " + y);
else
System.out.println("max = " + z);
}
for(int i = 0)
3、键盘录入
import java.util.Scanner;
public class Test {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
System.out.println(a);
Scanner sc = new Scanner(System.in);
System.out.println("Please input num = ");
double num = sc.nextDouble();
System.out.println(num);
System.out.println("Please input name = ");
String name = sc.next();
System.out.println(name);
System.out.println("Please input a = ");
String a = sc.nextLine();
System.out.println(a);
```