题目大意:输入字符串,按字典序输出所有排列。注意(A>a>B>b..)。使用头文件algorithm里面的sort(iterator start, iterator end ,cmp),next_permutation(iterator start, iterator end ,cmp)方法,该方法按cmp方法的比较输出全排列。
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
//将字符转为浮点数便于比较,因为同一个字母大小写在一起,所以小写字母-31.5
bool cmp(char a, char b){
double a1 = a;
double b1 = b;
if (a1 >= 97)