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 <Windows.h>
- int main() {
- //setlocale(0, "1251");
- //SetConsoleOutputCP(1251);
- float Xstart, Xfinish, x, y, h;
- int i = 0;
- printf("Please, input left limit: ");
- scanf("%f", &Xstart);
- printf("Please, input right limit: ");
- scanf("%f", &Xfinish);
- printf("Please, input increment: ");
- scanf("%f", &h);
- if (Xstart > 9 || Xfinish < -5) {
- puts("Function doesn't exist here");
- }
- else {
- printf("\xC9\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCB\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBB\n");
- printf("\xBA x \xBA y \xBA\n");
- x = Xstart;
- while ( x <= Xfinish ) {
- if (x <= 9 && x >= -5) {
- if (x <= 0) {
- if (x <= -3) {
- y = x + 3;// [-5;-3]
- }
- else {
- y = sqrt(9 - x * x);// (-3;0)
- }
- }
- else {
- if (x <= 6) {
- y = -(x / 2) + 3;// (0;6]
- }
- else {
- y = x - 6; // (6;9]
- }
- }
- printf("\xBA\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBA\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBA\n");
- printf("\xBA%6.2f \xBA%6.2f \xBA\n", x, y);
- }
- else {
- }
- x += h;
- }
- printf("\xC8\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCA\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBC\n");
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement