Baseball Eligibility


Submit solution

Points: 5
Time limit: 3.0s
Memory limit: 64M

Authors:
Problem type

題目說明

輸入兩整數 (安打數跟總打擊次數),計算出打擊率,如果打擊率超過0.300即有資格打明星賽
有的話輸出Eligible,沒有的話輸出Not Eligible

輸入限制: 正整數

Sample input1

60
200

Sample output1

Eligible

Sample input2

70
300

Sample output2

Not Eligible

Comments


  • 0
    scu12156253  commented on Oct. 19, 2023, 10:59 a.m.

    import java.util.Scanner; public class abcd {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
                Scanner s = new Scanner(System.in);
                double hit =s.nextDouble();
                double total =s.nextDouble();
                double rate = hit/total;
                if(rate>=0.3) {
                    System.out.print("Eligible");
                }
                else {
                    System.out.print("not Eligible");
                }
    }

    }


  • 0
    scu09156238  commented on Oct. 19, 2023, 10:32 a.m.

    打擊率:安打數/總打擊數