Laitofai

asdasda

Dec 12th, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     const float E=0.0001;
  9.     float y=1, ch=1, x, counter=1, zn=1, slag;
  10.     cin>>x;
  11.     while(x<=4){
  12.         ch*=(-2*x);
  13.         zn*=counter;
  14.         slag=ch/zn;
  15.         if(sqrt(slag*slag)>=E){
  16.             y+=slag;
  17.         }else{
  18.             break;
  19.         }
  20.         counter++;
  21.     }
  22.     cout<<y;
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment