SHARE
TWEET

Untitled

a guest Apr 18th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. #include<cmath>
  3. using namespace std;
  4. double f(double x)
  5. {
  6.     return sin(x);
  7. }
  8. double proizvedenie(double x)
  9. {
  10.     double pr=1;
  11.     for(int i=0;i<2;i++)
  12.     {
  13.         pr=pr*x;
  14.     }
  15.     return pr;
  16. }
  17.  
  18. double suma(double x)
  19. {
  20.     double sum=0;
  21.     for(int i=0;i<2;i++)
  22.     {
  23.         sum=sum+x;
  24.     }
  25. }
  26.  
  27. int main()
  28. {
  29.     int n;
  30.     cout<<"Vyvedi stepen: ";
  31.     cin>>n;
  32.     double x[3],y[3],pr1=1,pr2=1,sum=0;
  33.     for(int i=0;i<3;i++)
  34.     {
  35.         cin>>x[i];
  36.         y[i]=f(x[i]);
  37.     }
  38.     for(int k=0;k<n;k++)
  39.     {
  40.         for(int j=0;j<n&&j!=k;j++)
  41.         {
  42.             pr1=proizvedenie(x[k]-x[j]);
  43.             pr2=proizvedenie(0.655-x[j]);
  44.             sum=suma((y[k]/pr1)*pr1);
  45.         }
  46.     }
  47.     cout<<sum;
  48.     return 0;
  49.  
  50. }
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