hdu2626

来源:互联网 发布:淘宝网十字绣新款 编辑:程序博客网 时间:2024/05/22 05:00

Samuel's Schedule

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 901    Accepted Submission(s): 372
Problem Description
Welcome to ‘Samuel Design Contest’.Samuel greets you a happy 牛 Year. At new year and always,may peace and love fill your heart,beauty fill your world,joy and contentment fill your life and may you make great progress during the coming year both in your ACM and your study.The following problems are intended for you,especially for those rookies(usually known as “vegetable bird”in Chinglish).As it always does,the first problem is the easiest,I believe that you can work it out in a few minutes.The problem goes like this:Samuel is engaged at this new year's season and has a lot of things to do. For instance,he needs to buy new clothes,to prepare some food,to decorate the house and the like. Here is the schedule.
Based on the schedule,you need to answer what will Samuel do in N days before the New Year(2009.1.26 i the Spring Festival).
 
Input
The input include 2 parts:t(an integer,presents the t test cases),n(an integer,means n days before the New Year).
 
Output
Just output what Samuel will do according to the schedule,like this”Samuel will *******.”.
 
Sample Input
31332
 

Sample Output
Samuel will take test.Samuel will stay at home.Samuel will decorate.

AC代码:
#include<iostream>#include<algorithm>#include<cstring>#include<cstdio>int main(){    int t;    int n;    scanf("%d",&t);    while(t--)    {        scanf("%d",&n);         printf("Samuel will ");        if(n==13)       printf("take test");        else if(n==12)  printf("go home");        else if(n==11)  printf("stay at home");        else if(n==10)  printf("buy clothes");        else if(n==9)   printf("buy food");        else if(n==8)   printf("stay at home");        else if(n==7)   printf("visit teachers");        else if(n==6)   printf("go to KTV");        else if(n==5)   printf("meet friends");        else if(n==4)   printf("go to movies");        else if(n==3)   printf("stay at home");        else if(n==2)   printf("decorate");        else if(n==1)   printf("decorate");        else if(n==0)   printf("go out");        else if(n==-1)  printf("be in the park");        else if(n==-2)  printf("stay at home");        else if(n==-3)  printf("visit relative");        else if(n==-4)  printf("visit relative");        else if(n==-5)  printf("stay at home");        else if(n==-6)  printf("prepare dinner");       printf(".\n");    }    return 0;}
原创粉丝点击