Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <stdio.h>
- #include <iostream>
- #include "math.h"
- int main() {
- setlocale(0, "Russian");
- float x, y;
- printf("Введите x > ");
- scanf("%f", &x);
- if (x <= 9 && x >= -5) {
- if (x <= -3) {
- y = (-x) + 3;
- }
- if (x <= 0 && x > -3) {
- y = sqrt(9 - x * x);
- }
- if (x <= 6 && x > 0) {
- y = (-x / 2) + 3;
- }
- if (x > 6) {
- y = x - 6;
- }
- printf("y(%2.2f) = %2.2f\n", x, y);
- }
- else {
- printf("Функция не определена для x = %2.2f\n", x);
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement