📜  获得 n 个连续正面的预期试验次数 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:57.738000             🧑  作者: Mango

代码示例1
#include "bits/stdc++.h"
using namespace std;
  
// Driver Code
int main()
{
    int N = 3;
  
    // Formula for number of trails for
    // N consecutive heads
    cout << pow(2, N + 1) - 2;
    return 0;
}