2018年7月29日 星期日

Java You Cannot Pass?!

題目: You Cannot Pass?!


import java.util.Scanner;

public class PassScore{
    public static Scanner sc = new Scanner(System.in);
    public static int n,i,score;
 
    public static void main(String args[]){
        while(sc.hasNext()){
            n = sc.nextInt();
            score = 0;
   
            for(i = 1; i <= n; i++){
                score += sc.nextInt();
            }
   
            System.out.println((score > (59*n)) ? "no" : "yes" );
        }
    }
}

沒有留言:

張貼留言