Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

紧急求助 大家看看我这快排咋突然不好使了

Posted by vince4053040 at 2010-02-01 01:21:45 on Problem 1731
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator