标签:全排列 end else cout span include 序列 main begin
#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; }
标签:全排列 end else cout span include 序列 main begin
原文地址:https://www.cnblogs.com/yfr2zaz/p/10569065.html