#include <iostream>
using namespace std;
int main()
{
int a;
cin >> a;
int mas[3] = {a / 100, (a % 100) / 10, a % 10};
for (int jjj = 0; jjj < 3; jjj++)
for (int kkk = 0; kkk < 3; kkk++)
for (int lll = 0; lll < 3; lll++)
if (jjj != kkk and kkk != lll and lll != jjj)
if (!(jjj == 0 and kkk == 1 and lll == 2))
cout << mas[jjj] << mas[kkk] << mas[lll] << endl;
};
}
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
using namespace std;
int main()
{
int a;
cin >> a;
int mas[3] = {a / 100, (a % 100) / 10, a % 10};
for (int jjj = 0; jjj < 3; jjj++)
for (int kkk = 0; kkk < 3; kkk++)
for (int lll = 0; lll < 3; lll++)
{
if (jjj != kkk and kkk != lll and lll != jjj)
if (!(jjj == 0 and kkk == 1 and lll == 2))
cout << mas[jjj] << mas[kkk] << mas[lll] << endl;
};
}