64,649
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main()
{
int c;
string s="000001111111111";
c=3;
while(c!=0);
{
next_permutation(s.begin(),s.end());
cout<<s<<endl;
c--;
}
cout<<s<<endl;
system("pause");
}
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main()
{
int c;
string s="000001111111111";
c=3;
sort (s.begin(),s.end());
while(c!=0&&next_permutation(s.begin(),s.end()))
{
cout<<s<<endl;
c--;
}
cout<<s<<endl;
system("pause");
return 0;
}
while(c!=0);//把后面的分号去掉