Problem Description
Mike has many friends. Here are nine of them: Alice, Bob, Carol, Dave, Eve, Frank, Gloria, Henry and Irene.

Mike is so skillful that he can master n languages (aka. programming languages).

His nine friends are all weaker than he. The sets they can master are all subsets of Mike's languages.

But the relations between the nine friends is very complex. Here are some clues.

1. Alice is a nice girl, so her subset is a superset of Bob's.
2. Bob is a naughty boy, so his subset is a superset of Carol's.
3. Dave is a handsome boy, so his subset is a superset of Eve's.
4. Eve is an evil girl, so her subset is a superset of Frank's.
5. Gloria is a cute girl, so her subset is a superset of Henry's.
6. Henry is a tall boy, so his subset is a superset of Irene's.
7. Alice is a nice girl, so her subset is a superset of Eve's.
8. Eve is an evil girl, so her subset is a superset of Carol's.
9. Dave is a handsome boy, so his subset is a superset of Gloria's.
10. Gloria is a cute girl, so her subset is a superset of Frank's.
11. Gloria is a cute girl, so her subset is a superset of Bob's.

Now Mike wants to know, how many situations there might be.

Input
The first line contains an integer T(T≤20) denoting the number of test cases.

For each test case, the first line contains an integer n(0≤n≤3000), denoting the number of languages.

Output
For each test case, output ''Case #t:'' to represent this is the t-th case. And then output the answer.

Sample Input
2
0
2

Sample Output
Case #1: 1
Case #2: 1024

2个回答

#include
int main(void)
{
int M,A,B,C,D,E,F,G,H,I;
scanf("%d",&M);//M就是n
if(M>3000||M int count=0；
for(A=0;A for(B=0;B for(C=0;C for(D=0;D for(E=0;E for(F=0;F for(G=0;G for(H=0;H for(I=0;I {
if(A>B)continue;
if(B>C)continue;
if(D>E)continue;
if(E>H)continue;
if(H>I)continue;
if(E>C)continue;
if(D>G)continue;
if(G>F)continue;
if(G>B)continue;//利用continue语句逐一验证判断条件
count++；
printf("COUNT=%d,A=%d,B=%d,C=%d,D=%d,E=%d,F=%d,G=%d,H=%d,I=%d",
count,A,B,C,D,E,F,G,H,I);//逐一条件输出
}
return 0；
}

-

-

-

-

-

-

-

-

-
c语言生成数独表的算法
-

-

-
c语言中的算法和逻辑问题
-
A星算法用C语言如何写
-

-

-

-
c语言算法实现功能的题目
-
c语言学习数据结构和算法有什么好书推荐吗？
-
docker学习笔记
docker学习笔记 Docker是什么？ Docker是一个虚拟环境容器，可以将你的开发环境、代码、配置文件等一并打包到这个容器中，并发布和应用到任意平台中。比如，你在本地用Python开发网站后台，开发测试完成后，就可以将Python3及其依赖包、Flask及其各种插件、Mysql、Nginx等打包到一个容器中，然后部署到任意你想部署到的环境。 Docker官方文档比较全，建议有能力的读...

GitHub开源的10个超棒后台管理面板

100 个网络基础知识普及，看完成半个网络高手

C语言实现推箱子游戏

C语言这么厉害，它自身又是用什么语言写的？