http://www.spoj.pl/problems/PRLGAME2/很有意思的概率题目,具体怎么证明不明白,再多学学数学去吧。
另外发现了SPOJ这个优秀的OJ,多刷刷题了!
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <sstream>
#include <fstream>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <algorithm>
#define min(x,y) (x<y?x:y)
#define max(x,y) (x>y?x:y)
#define swap(t,x,y) (t=x,x=y,y=t)
#define distance(x1,x2,y1,y2,z1,z2) (sqrt(pow(x2-x1,2)+pow(y2-y1,2)+pow(z2-z1,2)))
#define myabs(x) (x<0?-x:x)
#define sgn(x) (x<0?-1:(x>0?1:0))
#define clr(list) memset(list,0,sizeof(list))
using namespace std;
int main()
{
int n,p,q;
int t=0;
while (scanf("%d%d%d",&n,&p,&q)==3)
{
printf("Case %d: %.4lf\n",++t,(double)(q+1)/(double)(p+2));
}
return 0;
}