#include <bits/stdc++.h>
using namespace std;
int main()
{
int a, b, c, d;
bool flag = false;
while (cin >> a >> b >> c >> d, a + b + c + d)
{
if(flag)
cout << endl;
else
flag = true;
vector <int> temp;
temp.push_back(a), temp.push_back(b), temp.push_back(c), temp.push_back(d);
int last = 0;
do
{
if(temp[0] == 0) continue;
if (last != 0 && temp[0] != last)
cout << endl;
if(temp[0] == last)
cout << ' ';
for(auto it : temp)
cout << it;
last = temp[0];
}
while (next_permutation(temp.begin(), temp.end()));
cout << endl;
}
}
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交