Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- using namespace std;
- #include <iostream>
- #include <iomanip>
- #include <cmath>
- int main()
- {
- setlocale(LC_ALL, "");
- float x,y;
- cout << "Задание #1" << endl;
- cout << endl;
- cout << "X = ";
- cin >> x;
- if (x >= -10 && x < -8)
- {
- y = -3;
- }
- else if (x >= -8 && x < -3)
- {
- y = (x + 3) / 5 * 3;
- }
- else if (x >= -3 && x < 3)
- {
- y = -sqrt(3 * 3 - x * x);
- }
- else if (x >= 3 && x < 5)
- {
- y = x - 3;
- }
- else if (x >= 5 && x <= 8)
- {
- y = 3;
- }
- cout << "Y = " << fixed << setprecision(1) << y << endl;
- cout << endl;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement