Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Laboratornaya_Rabota_2_v01.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <math.h>
- #include <iomanip>
- #include <iostream>
- #include <stdio.h>
- #include <conio.h>
- using namespace std;
- double result;
- class Y;
- class X
- {
- private:
- double x;
- double y;
- public:
- X ()
- {
- x=0.4e4;
- y=-0.875;
- }
- friend void run (X, X, Y);
- friend void print (X, X, Y);
- ~ X() {}
- };
- class Y
- {
- private:
- double z;
- public:
- Y ()
- {
- z=-0.475e-3;
- }
- friend void run (X, X, Y);
- friend void print (X, X, Y);
- ~ Y() {}
- };
- void run (X, X, Y)
- {
- X r1;
- X r2;
- Y r3;
- result = pow( (fabs(cos(r1.x) - cos(r2.y))), (1+2*sin(r2.y)*sin(r2.y))) * (1+r3.z+pow(r3.z,2)/2.+pow(r3.z,3)/3.+pow(r3.z,4)/4.);
- }
- void print (X, X, Y)
- {
- cout<<result<<endl;
- }
- void main()
- {
- X f1;
- X f2;
- Y f3;
- run (f1, f2, f3);
- print (f1, f2, f3);
- _getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement