Pagini recente » Cod sursa (job #2377403) | Cod sursa (job #950320) | Cod sursa (job #2551743) | Cod sursa (job #1813212) | Cod sursa (job #723869)
Cod sursa(job #723869)
# include <vector>
# include <algorithm>
# include <fstream>
using namespace std;
ifstream f ("permutari.in");
ofstream g ("permutari.out");
unsigned n;
vector <int> st;
void init ()
{
int y,l;
f >> l;
f.close();
for(y=0; y<l; y++)
{
st.push_back(y+1);
}
}
void Show ()
{
for (int i=0; i<st.size(); i++)
{
g << st[i] << ' ';
}
g << '\n';
}
int main ()
{
init();
do
{
Show();
}
while (next_permutation(st.begin(),st.end()));
g.close();
return 0;
}