☐ + ☐ + ☐ = 30, ☐ 里填{1, 3, 5, 7, 9, 11, 13, 15} 可以重复填
当然答案是不存在的 不过我想知道用C语言实现 有没有简洁的方法 因为用C++写是很简洁的
程序代码:
// g++ -Wall -fomit-frame-pointer -funroll-loops -Ofast -msse4.2 -mavx -std=c++11 a.cpp -lm -o a
#include <iostream>
#include <vector>
using std::cout;
using std::cin;
using std::endl;
using std::vector;
int main(void)
{
vector<int> nums = {1, 3, 5, 7, 9, 11, 13, 15};
for (auto i : nums)
for (auto j : nums)
for (auto k : nums)
if (i + j + k == 30)
cout << i << " + " << j << " + " << k << " = 30." << endl;
return 0;
}




