帮忙解决一道简单C++题目

[复制链接]
查看11 | 回复1 | 2010-2-3 13:34:07 | 显示全部楼层 |阅读模式
#include using namespace std;int main(){
int a,b,c,d,e=0;
for(a=1;a 1){
for(c=b+1;c 1){
for(d=c+1;d 1){
//cout << a << " " << b << " " << c << " " << d << endl;
e++;
}
}
}
} }} } cout << e;
system("pause"); return 0;} 这个是枚举法
回复

使用道具 举报

千问 | 2010-2-3 13:34:07 | 显示全部楼层
int count_Combination_NoNeighboring(int n, int r)源程序请参见参考资料:http://blog.csdn.net/n43e120/archive/2010/02/03/5284557.aspx

已赞过已踩过<
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行