Nyoj806 HEIHEI mood

Source: Internet
Author: User

Nyoj806 HEIHEI mood

 

Description

The HEIHEI mood value is the sum of the morning, afternoon, and evening mood values. Because HEIHEI has classes from Monday to Friday, you do not need to enter the mood value of 0 for homework at night, that is, there are only two mood values from Monday to Friday in the morning and afternoon, then, the total mood of HEIHEI is the sum of these two mood values. However, for Saturday and Sunday holidays, HEIHEI will play games at night, which will generate a mood value. The mood value on Saturday and Sunday is the sum of the mood values in the morning, afternoon, and evening. Now HEIHEI tells you the day of the week (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) and her mood values, please calculate the sum of her mood values '(* Your _ Your *)′. If "Monday 23 54" is input, 77 should be output. If "Saturday 23 65 56" is input, the sum is 144.

 
Input
Enter a number in the first row to indicate that t groups of test data exist (1 <= t <= 100 ).
Next, there will be t rows. Each line represents the day of the week and the mood value of the day.
Output
The number of output lines indicates the total mood value of the day.
Sample Input
7Sunday 21 11 71Friday 27 44Tuesday 29 34Monday 13 18Tuesday 73 5Friday 35 85Saturday 68 25 11
Sample output
10371633178120104

 

#include 
   
    #include 
    
     int main(){int ncase;char week[7][20]={"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};scanf("%d",&ncase);while(ncase--){char str[20];int a,b,c;scanf("%s",str);for(int i=0;i<7;i++){if(strcmp(str,week[i])==0){if(i<5){scanf("%d %d",&a,&b);printf("%d\n",a+b);}else{scanf("%d %d %d",&a,&b,&c);printf("%d\n",a+b+c);}break;}}}return 0;}
    
   

Related Keywords:
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.