#include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
//freopen("data.in","r",stdin);
int T;
scanf("%d",&T);
while(T--)
{
int h,n;
scanf("%d %d",&h,&n);
char str[20];
int i;
for(i=0;i<h-n;i++)
str[i]='0';
for(;i<h;i++)
str[i]='1';
str[i]=0;
do
{
printf("%s\n",str);
}while(next_permutation(str,str+i));
if(T)
printf("\n");
}
return 0;
}
729 - The Hamming Distance Problem
最新推荐文章于 2021-09-05 19:45:00 发布
本文介绍了一段使用C++语言实现的程序,该程序通过生成器表达式来打印一系列序列,利用循环和条件判断,展示了如何在C++中高效地生成并打印特定序列。
121

被折叠的 条评论
为什么被折叠?



