// 多项式求值.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include<iostream>
using namespace std;
void perml(int m,int P[],int n)
{
int change,change1;
if(m==n)
{
for(int i=1;i<=n;i++)
{
cout<<P[i]<<" ";
}cout<<endl;
}else
{
for(int j=m;j<=n;j++)
{
change=P[j];
P[j]=P[m];
P[m]=change;
perml(m+1,P,n);
change1=P[j];
P[j]=P[m];
P[m]=change1;
}
}
}
int main(int argc, char* argv[])
{
int num;
int ch[100];
cout<<"请输入数的个数"<<endl;
cin>>num;
cout<<"请输入"<<num<<"个数"<<endl;
for(int i=1;i<=num;i++) cin>>ch[i];
perml(1,ch,num);
return 0;
}