为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

紫衣仙女 2021-06-25 19:07:00
如果没有其他错误,此代码会不断获取。我在这里看不到问题。请帮忙。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");            }        }    }}它说在每个“其他”上都有一个错误。
查看完整描述

3 回答

  • 3 回答
  • 0 关注
  • 150 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信