Guess Season


Submit solution

Points: 2 (partial)
Time limit: 2.0s
Memory limit: 64M

Authors:
Problem type

輸入溫度並預測季節

輸入限制: 數字

Input

溫度(華氏)

Output

季節

Sample Input

80

Sample Output

Spring

Comments


  • 0
    scu12156201  commented on Oct. 15, 2023, 2:41 p.m. edited

    cool


  • 0
    scu12156254  commented on Oct. 12, 2023, 11:30 a.m.

    import java.util.Scanner;

    public class fyy23 {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner s =new Scanner(System.in);
    
        int T = s.nextInt();
    
        if(T>=90)
           System.out.print("Summer");
        else if(90>T&T>=70)
           System .out.print("Spring");
        else if(70>T&T>=50)
           System.out.print("Fall");
        else if(T<=50&T>=-5)
           System.out.print("Winter");
        else if(T>110)
            System.out.print("Invalid");
        else if (T<-5)
         System.out.print("Invaild");
    
    
    
    }

    }


  • 0
    guest_2  commented on Oct. 12, 2023, 11:07 a.m. edit 2

    溫度 >= 90 Summer

    90 > 溫度 >= 70 Sprint

    70 > 溫度 >= 50 Fall

    溫度 < 50 Winter

    溫度 > 110 或 溫度 < -5 Invalid


  • 0
    scu12156247  commented on Oct. 12, 2023, 10:49 a.m.

    import java.util.*;

    public class h_1 {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
    
        Scanner s = new Scanner(System.in);
        double F = s.nextInt();
        double C = (F-32)*5/9;
    
        System.out.println(C);
    
    }

    }