#include<stdio.h>
#include<stdlib.h>
#define SUM 6
int state[SUM];
void book(int book_lend,int book_return,int num,int count)
{
if (book_lend == 0)
{
for (int i = 0; i < SUM; i++)
{
printf("%d * ",state[i]);
}
printf("\n");
printf("\b\b\b\b ");
}
if (book_return == 0 && count>0)
{
state[num] = -1;
book(book_lend - 1, book_return, num + 1, count-1);
}
if (count>0&&book_return>0)
{
state[num] = -1;
book(book_lend - 1, book_return, num + 1, count-1);
state[num] = 1;
book(book_lend, book_return - 1, num + 1, count+1);
}
if (book_return > 0&&count==0)
{
state[num] = 1;
book(book_lend, book_return - 1, num + 1, 1+count);
}
}
int main(void)
{
book(3,3,0,0);
return 0;
}