随笔-65  评论-6  文章-0  trackbacks-0
 1 #include <cstdio>
 2 #include <cstdlib>
 3 #include <string>
 4 #include <cmath>
 5 #include <algorithm>
 6 #include <iostream>
 7 #include <sstream>
 8 using namespace std;
 9 
10 int main(){
11     #ifndef ONLINE_JUDGE
12     freopen("in.txt","r",stdin);
13     #endif
14      int t,i;
15      __int64 n;
16      int a[23]={0,2,6,20,72,72,56,60,12,92,56,0,52,12,56,40,92,32,56,80,32,52,56};
17      int b[20]=      {20,72,72,56,60,12,92,56,0,52,12,56,40,92,32,56,80,32,52,56};
18      while (scanf("%d",&t),t){
19          for (i=1;i<=t;i++){
20              scanf("%I64d",&n);
21              if (n<=22)
22                  printf("Case %d: %d\n",i,a[n]);
23              else{
24                  n=(n-3)%20;
25                  printf("Case %d: %d\n",i,b[n]);
26              }
27          }
28          printf("\n");
29      }
30      return 0;
31 }
posted on 2012-05-28 09:50 Leo.W 阅读(379) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理