首页 > 其他 > 详细

扑克序列

时间:2019-03-21 00:47:44      阅读:190      评论:0      收藏:0      [点我收藏+]

技术分享图片

#include<iostream>
#include<algorithm>
using namespace std;
bool check(const string &s){
    if(s.rfind(‘A‘)-s.find(‘A‘)==2&&
    s.rfind(‘2‘)-s.find(‘2‘)==3&&
    s.rfind(‘3‘)-s.find(‘3‘)==4&&
    s.rfind(‘4‘)-s.find(‘4‘)==5
    )
    return 1;
    else
    return 0;
}
int main(){
    string s="223344AA";
    do{
        if(check(s))
        cout<<s<<endl;
    }while(next_permutation(s.begin(),s.end()));
    //全排列枚举 
    return 0;
} 

 

扑克序列

原文:https://www.cnblogs.com/yfr2zaz/p/10569065.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!