生活随笔
收集整理的這篇文章主要介紹了
POJ 1256
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
POJ1526
1.題目描述
2.代碼:
#include<iostream>
#include<string>
#include<algorithm>
using namespace std
;
int cmp(char a
,char b
)
{if(tolower(a
)!=tolower(b
))return tolower(a
)<tolower(b
);elsereturn a
<b
;
}
int main()
{char ch
[20];int n
;
cin
>>n
;while(n
--)
{
scanf("%s",ch
);
sort(ch
,ch
+strlen(ch
),cmp
);do
{
printf("%s\n",ch
);
}while(next_permutation(ch
,ch
+strlen(ch
),cmp
));
}return 0;
}
總結(jié)
以上是生活随笔為你收集整理的POJ 1256的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。