计算二项式系数之和 c++
看下STL的
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int NUM = 9;
int myints[] = { 1,2,3,4,5,6,7,8,9,0};
sort(myints, myints + NUM);
int num = 0;
do
{
num++;
for (int i = 0; i < NUM; ++i);
//cout << myints[i] << ' ' ;
//std::cout << std::endl;
} while (next_permutation(myints, myints + NUM));
std::cout << num << std::endl;
for (int i = 0; i < NUM; ++i)
cout << myints[i] << ' ' ;
//cout << "After loop: " << myints[0] << ' ' << myints[1] << ' ' << myints[2] << ' ' << myints[3] << '\n';
return 0;
}