c++ 实现整数的拆分
来源:互联网 发布:阿里云电视系统升级 编辑:程序博客网 时间:2024/04/30 20:53
// interDived.cpp : Defines the entry point for the console application.
//Writed by Johsnon Chen 2010/10/12
#include "stdafx.h"
#include <vector>
#include <iostream>
using namespace std;
vector<int> iVec;
void split_int(int n, int base)
{
if(n == 0)
{
cout << "find a combination: ";
for(vector<int>::size_type i= 0; i < iVec.size(); ++i)
cout << iVec[i] << " ";
cout << endl;
return;
}
else
{
for(int i = base + 1; i <= n; i++)
{
iVec.push_back(i);
split_int(n - i, i);
iVec.erase(--iVec.end());
}
}
}
int _tmain(int argc, _TCHAR* argv[])
{
split_int(6, 0);
return 0;
}
- c++ 实现整数的拆分
- 整数的拆分
- ecnu1009 - 整数的拆分
- 整数的拆分问题
- 整数的加法拆分
- 整数的拆分问题
- 整数的拆分1
- 整数的拆分2
- 整数的拆分3
- 整数的拆分
- 整数的拆分
- 2173: 整数的lqp拆分
- 寒假21:整数的拆分
- 整数的素数对拆分
- 2173: 整数的lqp拆分
- C语言实例--拆分一个整数
- 巧用union实现整数高低位拆分
- 将整数m拆分为n个数字的有序拆分方案数为C(m-1,n-1)
- 获取有多少台电脑连接到该数据库的问题
- 推荐一个好用的ColorPicker Silverlight 控件
- gridview数据导出到Excel的研究
- 诺基亚邓元鋆:MeeGo向电脑级智能发展
- gridview与exel
- c++ 实现整数的拆分
- 云计算、分布式、SOA的概述
- 云计算、分布式、SOA的概述
- 如何解决 Internet Explorer 9 安装问题
- afxgetapp()
- 亲人只有一次的缘分,无论这辈子我和你会相处多久,都请好好珍惜共聚的时光,因为,下辈子,无论爱与不爱,我们都不会再见了……
- ---
- 好久没来这了
- How to use "man" effectively in the development of Linux