SHARE
TWEET

Poly ++

a guest Jan 28th, 2020 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<cmath>
  2.  
  3. int calculatePolynomial(int x, int y, int z)
  4. {
  5.     int n = 4; //ne e kazano N kolko e zatova mojesh da mu dadesh kakvato i da e stoinost tuka
  6.    
  7.     int result = 0;
  8.    
  9.     for (int i = 0; i < n; i++)
  10.         {
  11.             int xN = pow(x, i);
  12.             int yN = y*(n-i);
  13.             int zN = pow(z, n-i);
  14.  
  15.             result += xN * yN * zN;
  16.         }
  17.     return result;
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top