| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
紧急求助 大家看看我这快排咋突然不好使了#include<iostream>
#include<string>
#include<stdlib.h>
#include<algorithm>
using namespace std;
#define MAX 202
int cmp ( const void *a , const void *b )
{
return *(int *)a - *(int *)b;
}
int main()
{
char a[MAX];
int len, i;
scanf("%s", a);
len = strlen(a);
qsort(a, len , sizeof(char), cmp); //快排咋不行了
while(1) {
for(i = 0;i < len; i ++)
printf("%c", a[i]);
cout << endl;
if(!next_permutation(a,a+len)) break;
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator