![在这里插入图片描述](https://img-blog.csdnimg.cn/1274d39fc270414399f4e783a18839e1.png)
思路:
考虑当前鞋带头不打环的概率,就是不和它为同一条鞋带的个数*2,把所有都乘起来就可以了
c
o
d
e
code
code
#include<iostream>
#include<cstdio>
using namespace std;
int n;
int main()
{
scanf("%d", &n);
double ans=1;
for(int i=0; i<n*2-2; i+=2)
ans=ans*(2*n-i-2)*1.0/(2*n-i-1)*1.0;
printf("%.6lf", ans);
return 0;
}