楼主说的S的值首先就是错误的,应该是 对 i^2 求和 ,i 属于{ 1,........25}
何况确实这道题不用考虑的这么复杂,A和每个女生跳舞的几率都是一样的,是stochastisch unabhaengig gleich verteilt,而总的几率是1(A总能和一个女生跳舞),所以A和B跳舞的几率就是1/25了。
Debugging is twice as hard as writing the code in the first place. Therefore,if you write the code as cleverly as possible,you are, by definition,not smart enough to debug it.-- Brian W. Kernighan

TOP