Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- double VlozhCikl(double a, double b, double hx, double c, double d, double hy)
- {
- int n = ceil((b-a)/hx)+1;
- int m = ceil((d-c)/hy)+1;
- double res = 0;
- double x, y, z;
- for(int i = 1; i<=n; ++i){
- x = a+(i-1)*hx;
- for(int j = 1; j<=m; ++j){
- y = c+(j-1)*hy;
- z = (pow(y, 1 / 4) / (3 * x));
- if(z<0.0)res += z;
- }
- }
- return res;
- }
- int main()
- {
- double a, b, hx, c, d, hy;
- cin >> a >> b >> hx >> c >> d >> hy;
- double res = VlozhCikl(a, b, hx, c, d, hy);
- cout << res;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement