Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- double func(double x) {
- return (pow(sin(x),3) - 3 );
- }
- double RegCikl(double a, double b, double h, double &Proizv) {
- double x, y;
- double Sum = 0;
- for (x = a; x <= b; x += h) {
- y = func(x);
- Sum+=y;
- Proizv*=y;
- }
- return Sum;
- }
- int main()
- {
- double a,b,h, Proizv = 1;
- cin >> a >> b >> h;
- double Sum = RegCikl(a,b,h, Proizv);
- cout << Sum << " " << Proizv;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement