三目运算符判断

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int x = in.nextInt();
        int y = (x > 0)? -1 : (x == 0) ? 0 : 1;
        System.out.println(y);
    }
}