题目给出了计算概率的公式,则直接模拟公式即可,公式中的△x就等于(b - a) / 500。求出每个xi的值再求和即可。
C++
#include<bits/stdc++.h>
using namespace std;
double a, b;

By signing up a CodeFun2000 universal account, you can submit code and join discussions in all online judging services provided by us.