a148: You Cannot Pass?!

題目:http://zerojudge.tw/ShowProblem?problemid=a148
程式碼:

import java.util.Scanner;
public class a148 {

 public static void main(String[] args) {
  // TODO Auto-generated method stub
  Scanner sc = new Scanner(System.in);
  while(sc.hasNext()){
   int a = sc.nextInt();
   int count=0;
   for(int i=0;i<a;i++){
    count += sc.nextInt();
   }
   if( count > a*59){
    System.out.println("no");
   }else{
    System.out.println("yes");
   }
  }

 }

}

留言

熱門文章