相关疑难解决方法(0)

错误:'else'没有'if'

没有if语句获取else:

import java.util.Scanner;

public class LazyDaysCamp
{
    public static void main (String[] args)
    {
        int temp;
        Scanner scan = new Scanner(System.in);

        System.out.println ("What's the current temperature?");
        temp = scan.nextInt();
        if (temp > 95 || temp < 20);
            System.out.println ("Visit our shops");
            else if (temp <= 95)
                if (temp >= 80)
                System.out.println ("Swimming");
                else if (temp >=60) 
                    if (temp <= 80)
                    System.out.println ("Tennis");
                    else if (temp >= 40)
                        if (temp < 60)
                        System.out.println ("Golf");
                        else if (temp < 40)
                            if (temp …
Run Code Online (Sandbox Code Playgroud)

java scope if-statement curly-braces

3
推荐指数
1
解决办法
7万
查看次数

标签 统计

curly-braces ×1

if-statement ×1

java ×1

scope ×1