Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- float F(float x)
- {
- if (abs(x) < 2) return sqrt(5*pow(x,2)+5);
- else if (abs(x) >= 10) return 0;
- else return abs(x)/(sqrt(5 * pow(x, 2) + 5));
- }
- void F(float x, float &y)
- {
- if (abs(x) < 2) y = sqrt(5 * pow(x, 2) + 5);
- else if (abs(x) >= 10) y = 0;
- else y = abs(x) / (sqrt(5 * pow(x, 2) + 5));
- cout << y;
- }
- int main()
- {
- float y, x;
- cout << "x = "; cin >> x;
- F(x, y);
- cout << F(x);
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment