Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- const float E=0.0001;
- float y=1, ch=1, x, counter=1, zn=1, slag;
- cin>>x;
- while(x<=4){
- ch*=(-2*x);
- zn*=counter;
- slag=ch/zn;
- if(sqrt(slag*slag)>=E){
- y+=slag;
- }else{
- break;
- }
- counter++;
- }
- cout<<y;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment