Advertisement
TheMagnusRex

20

Mar 26th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4.  
  5. using namespace std;
  6.  
  7. double y(double x){
  8.     return (1/(x+7.0))+ log(1-abs(x));
  9. }
  10.  
  11. int main()
  12. {
  13.     double x,h;
  14.     double b;
  15.     cout<<"vvedite a ";
  16.     cin>>x;
  17.     cout<<"vvedite b ";
  18.     cin>>b;
  19.     cout<<"vvedite shag ";
  20.     cin>>h;
  21.     while(x<=b){
  22.         if(x==-7||abs(x)>=1){
  23.             cout<<"pri x="<<x<<" "<<"func ne opredelena"<<endl;
  24.             x+=h;
  25.         }
  26.         else{
  27.             cout<<"x="<<x<<"   "<<"y="<<y(x)<<"   "<<endl;
  28.             x+=h;
  29.         }
  30.     }
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement