Advertisement
Pafnytiu

система 6 - 10

Nov 17th, 2015
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include<iostream>
  2. #include<cmath>
  3. using namespace std;
  4. float func(float x)
  5. {if ((x + 2) <= 1) return pow(x, 2);
  6. else if (1 < (x + 2) < 10) return 1 / (x + 2);
  7. else return (x + 2);}
  8. int main()
  9. {float a,b,h,x;
  10. cin>>a;
  11. cin>>b;
  12. cin>>h;
  13. cout<<"x\tfunc(x)\n"<<endl;
  14. for(x=a; x<=b; x+=h)
  15. cout<<x<<"\t"<<func(x)<<endl;
  16. system("pause");
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement