#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
屏幕剪辑的捕获时间: 2012-5-31 9:45
int a[3]={1,2,3};
int i;
do
{
for(i=0;i<=2;i++)
printf("%d ",a[i]);
printf("\n");
}while(next_permutation(a,a+3));
return 0;
}
![](https://img-my.csdn.net/uploads/201207/20/1342782053_4817.png)