标签:href pac int gif 题目 def none show nbsp
题目大意:7个东西,每个有ai个,只有选7次
把7个东西都选到了才行。
题解:7!排列数*每次选择的概率
代码:
#include<iostream> #include<cstdio> using namespace std; double a1,a2,a3,a4,a5,a6,a7; double sum; int main(){ cin>>a1>>a2>>a3>>a4>>a5>>a6>>a7; sum=a1+a2+a3+a4+a5+a6+a7; printf("%.3lf\n",5040*a1/sum*a2/(sum-1)*a3/(sum-2)*a4/(sum-3)*a5/(sum-4)*a6/(sum-5)*a7); return 0; }
标签:href pac int gif 题目 def none show nbsp
原文地址:http://www.cnblogs.com/zzyh/p/7811381.html