这段代码不断得到 else 没有 if 错误

如果没有其他错误,此代码会不断获取。我在这里看不到问题。请帮忙。


import java.util.Scanner;


public class TempOut {

    public static void main(String[] args) {

        //variable

        double t;

        double v;

        Scanner input = new Scanner(System.in);


        //inputs

        System.out.print("Give temperature(C): ");

        t = input.nextDouble();

        System.out.print("Give wind velocity(km/h): ");

        v = input.nextDouble();


        //formula

        if (((t>=-50) & (t=<5)) | 3>=v) 

        {

            double formula = 13.12 + (2*(0.6251*t)) - (11.37*v) + ((0.3965*t)*v);

            System.out.print("The wind chill temperature is : "+formula);

        }

        else {

            if (((t<-50) & (t>5)) | v=<3) 

            {

            System.out.print("Formula not suitable");

            }

            else {

                System.out.print("Invalid input");

            }

        }

    }

}

它说在每个“其他”上都有一个错误。


紫衣仙女
浏览 151回答 3
3回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java