分支-03. 三天打鱼两天晒网-B3

时间:2014-06-07 08:31:58   收藏:0   阅读:195
bubuko.com,布布扣
 1 /*B3-分支-03. 三天打鱼两天晒网
 2  *Main.c
 3  *测试通过
 4  */
 5 
 6 #include <stdio.h>
 7 #include <stdlib.h>
 8 int main()
 9 {
10     int day;
11     int reminder;
12 
13         scanf("%i", &day);
14         if (day <= 0 || day > 1000)
15             exit(0);
16         reminder = day % 5;
17         if (reminder == 0)
18         {
19             printf("Drying in day %i\n", day);
20         }
21         else
22         {
23             if (reminder <= 3)
24             {
25                 printf("Fishing in day %i\n", day);
26             }
27             else
28             {
29                 printf("Drying in day %i\n", day);
30             }
31         }
32     return 0;
33 }
bubuko.com,布布扣

 

分支-03. 三天打鱼两天晒网-B3,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!