UVA 12464 - Professor Lazy, Ph.D.(恶搞)

题目链接

当以为是神题的时候,其实他是个恶搞题。挺不错的一个题。耐下心来,仔细想想就OK。

View Code
 1 #include <stdio.h>
 2 #include <string.h>
 3 int main()
 4 {
 5     long long  a,b,n;
 6     while(scanf("%lld%lld%lld",&a,&b,&n)!=EOF)
 7     {
 8         if(!a&&!b&&!n) break;
 9         n = n%5;
10         if(n == 0)
11         printf("%lld\n",a);
12         else if(n == 1)
13         printf("%lld\n",b);
14         else if(n == 2)
15         printf("%lld\n",(1+b)/a);
16         else if(n == 3)
17         printf("%lld\n",(1+a+b)/a/b);
18         else if(n == 4)
19         printf("%lld\n",(a+1)/b);
20     }
21     return 0;
22 }
posted @ 2012-07-31 09:52  Naix_x  阅读(233)  评论(0编辑  收藏  举报