文章
1
粉丝
0
获赞
6
访问
239
#include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>
using namespace std;
const int N = 1010;
int main()
{
std::ios::sync_with_stdio(false);
int w[N];
int cnt = 0;
cout << 64 << endl;
printf("1\n2\n3\n4\n12\n13\n14\n21\n23\n24\n31\n32\n34\n41\n42\n43\n");
string s = "123";
do
{
w[cnt++] = (s[0] - '0') * 100 + (s[1] - '0') * 10 + (s[2] - '0');
} while (next_permutation(s.begin(), s.end()));
s = "124";
do
{
w[cnt++] = (s[0] - '0') * 100 + (s[1] - '0') * 10 + (s[2] - '0');
} while (next_permutation(s.begin(), s.end()));
s = "134";
do
{
w[cnt++] = (s[0] - '0') * 100 + (s[1] - '0') * 10 + (s[2] - '0');
} while (next_permutation(s.begin(), s.end()));
s = "234";
do
{
w[cnt++] = (s[0] - '0') * 100 + (s[1]...
登录后发布评论
printf改为cout
cout << "1\n2\n3\n4\n12\n13\n14\n21\n23\n24\n31\n32\n34\n41\n42\n43\n";
printf和cout尽量不要混用