Fork me on GitHub

NYOJ题目806HEIHEI的心情

---------------------------------------

AC代码:

 1 import java.util.Scanner;
 2 
 3 public class Main {
 4 
 5     public static void main(String[] args) {
 6         
 7         Scanner sc=new Scanner(System.in);
 8         
 9         int times=Integer.parseInt(sc.nextLine());
10         while(times-->0){
11             String ss[]=sc.nextLine().split(" ");
12             int ans=0;
13             if("Sunday".equals(ss[0]) || "Saturday".equals(ss[0])){
14                 ans=Integer.parseInt(ss[1])+Integer.parseInt(ss[2])+Integer.parseInt(ss[3]);
15             }else{
16                 ans=Integer.parseInt(ss[1])+Integer.parseInt(ss[2]);
17             }
18             System.out.println(ans);
19         }
20         
21     }
22     
23 }

 

题目来源: http://acm.nyist.net/JudgeOnline/problem.php?pid=806

 

posted @ 2016-08-31 08:21  CC11001100  阅读(158)  评论(0编辑  收藏  举报