三元运算符格式:关系表达式?表达式1:表达式2 (python语法相同)
数据输入:
import java.util.Scanner;
public class OperatorDemo {
public static void main(String[] args) {
//创建对象
Scanner sc = new Scanner(System.in);
//接收数据
int x = sc.nextInt();
System.out.println(x);
}
}



