借书方案
#include <stdio.h>
int main()
{
int i, j, k, n = 0;
for (i = 1; i <= 5; i++)
{
for (j = 1; j <= 5; j++)
{
if (j == i)continue;
for (k = 1; k <= 5; k++)
{
if (k == j || k == i)continue;
printf("%d %d %d ", i, j, k);
n++;
}
printf("\n");
}
//printf("\n");
}
printf("共有%d种借书方法", n);
return 0;
}