if语句没有输出结果是为什么?我还有哪里错了?大神们帮帮我?

package zy;

import java.util.Scanner;
public class two {

public static void main(String[] args) {
    // TODO Auto-generated method stub
    Scanner scan=new Scanner(System.in);
    double x,y;
    System.out.print("x=:");
    x=scan.nextDouble();
    y=scan.nextDouble();
    if(x>1000)
        System.out.println("x的值不能超过1000,请重新输入!");
    if(x>=100&&x<=1000)
        System.out.println("y="+3*x+-11);
    if(10<=x&&x<20)
        System.out.println("y="+2*x+-1);
    if (0<x&&x<10)
        System.out.println("y="+x);
    if(x<0)
        System.out.println("x必须为正,请重新输入!");
    

img


你的这三行语句能正常执行吗
建议你输出x 和 y测试一下

你在接收用户输入的时候,提示只写了x的,提示用户输入y美哦与写,你在控制台应该输入两个数回车后才有输出.可以改成下面代码


```java
 public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner scan = new Scanner(System.in);
        double x, y;
        System.out.print("x=:");
        x = scan.nextDouble();
        System.out.println("y=:");
        y = scan.nextDouble();
        if (x > 1000)
            System.out.println("x的值不能超过1000,请重新输入!");
        if (x >= 100 && x <= 1000)
            System.out.println("y=" + 3 * x + -11);
        if (10 <= x && x < 20)
            System.out.println("y=" + 2 * x + -1);
        if (0 < x && x < 10)
            System.out.println("y=" + x);
        if (x < 0)
            System.out.println("x必须为正,请重新输入!");

    }

```