注册 登录
编程论坛 JAVA论坛

问题:计算风寒湿度(要求风速必须>=2,华氏度在-58度至41度之间)

bug娃娃 发布于 2019-05-01 17:01, 1976 次点击
只有本站会员才能查看附件,请 登录

package homeWork;
import java.util.Scanner;

public class T0822 {
   
    public static void main(String[] args) {   
            Scanner input = new Scanner(System.in);
            //prompt the user to enter the fahrenheit and wind chill index
            System.out.print("Enter the tempreture in fahrenheit between -58 °F and 41 °F:");
            double tempreture = input.nextDouble();
            
            System.out.print("Enter the wind speed miles per hour(must be greater than or equal to 2:");
            double windChill = input.nextDouble();
            
            if(tempreture >= (-58) && tempreture <= 41 && windChill >= 2) {
                  //T是风寒温度
                  double T = 35.74 + 0.6215 * Math.pow(windChill, 0.16) + 0.4275 * Math.pow(tempreture,0.16);
                  System.out.println("The wind chill index is " + T);           
            }
            else
                System.out.println("Can't run");
            
            input.close();                    
        }
}
出现了这种状况,请教大家,这是什么?
只有本站会员才能查看附件,请 登录

2 回复
#2
rind2019-05-01 18:36
Reason:后面就是原因,复制然后打开谷歌翻译。

保存为GBK编码的文件发现有没有对应编码的字符。
#3
bug娃娃2019-05-02 15:00
喔喔,这个还需要英语很好呢
1