void 可表示的数(数组前面2个数的和)()
{
int aa[]{1,2,3,4,5,6,7,8,9}, j = 0, z = 1, jj = z, n = 9, ge = 0;
string a = "";
while (j < n)//缘由https://bbs.csdn.net/topics/396063706?page=1#post-410898529
{
if (++jj < n)
if (aa[j] + aa[z] == aa[jj])
if (a.find(to_string(aa[jj])) == string::npos)
++ge, cout << aa[j] << "+" << aa[z] << "=" << aa[jj] << ends, a.push_back(aa[jj] + '0'), a += ","; else 0; else 0;
else if (++z >= n)
jj = z = ++j + 1;
else jj = z;
}
cout << ge;
}
int aa[]{1,2,3,4,5,6,7,8,9}
假如不限制重复的话