所以我无法通过循环将我找到的除数添加到矢量数组中。将元素添加到矢量数组
#include <iostream>
#include <vector>
using namespace std;
vector <int> numbers;
bool isSummableNumber(int num)
{
for (int i=1; i<=num; i++)
{
if (num%i==0)
{
// this is where I need to send them to the array
}
}
在我INT主()我已要求用户输入一个数字,并通过循环,我觉得所有的除数,然后我无法将它们添加到阵列。
看到http://msdn.microsoft.com/de-de /library/7fthz5xd.aspx – road242