Advertisement
Jgug

l3_v10

Dec 27th, 2012
446
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <math.h>
  3. #include <iomanip>
  4. #include <iostream>
  5. #include <stdio.h>
  6. #include <conio.h>
  7.  
  8. using namespace std;
  9.  
  10. double result;
  11.  
  12. class Y;
  13. class X
  14. {
  15.     private:
  16.        double x;
  17.        double y;
  18.     public:
  19.         X () {
  20.         x = 6.251;
  21.         y = 0.827;
  22.         }
  23.     friend void run (X, X, Y);
  24.     friend void print (X, X, Y);
  25.     ~ X() {}
  26. };
  27.  
  28. class Y
  29. {
  30.     private:
  31.        double z;
  32.     public:
  33.         Y () {
  34.         z = 25.001;
  35.         }
  36.     friend void run (X, X, Y);
  37.     friend void print (X, X, Y);
  38.     ~ Y() {}
  39. };
  40.  
  41.  
  42. void run (X, X, Y)
  43. {
  44.     X r1;
  45.     X r2;
  46.     Y r3;
  47.     result = pow(r2.y, pow(abs(r1.x), 1/3.)) + pow(cos(r2.y), 3) * ( abs(r1.x - r2.y) * abs(1 + (pow(sin(r3.z), 2))/(sqrt(r1.x+r2.y))) / ( exp(abs(r1.x-r2.y)) + 1/(pow(r2.y,2)+1)));
  48. }
  49.  
  50. void print (X, X, Y)
  51. {
  52.     cout<<result<<endl;
  53. }
  54.  
  55. void main()
  56. {
  57.     X f1;
  58.     X f2;
  59.     Y f3;
  60.     run (f1, f2, f3);
  61.     print (f1, f2, f3);
  62.     _getch();
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement