Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <conio.h>
- #include <math.h>
- #include <stdio.h>
- #include <windows.h>
- main() {
- SetConsoleCP(1251);
- SetConsoleOutputCP(1251);
- float x, z, a, b;
- char Error_text[] = "NET resheniay";
- printf("Vvedite a: ");
- scanf("%f",&a);
- printf("Vvedite b: ");
- scanf("%f",&b);
- printf("Vvedite x: ");
- scanf("%f",&x);
- if (x>0) {
- if (x<=a) {z=log(x)+sin(x);}
- else {
- if ((a<x)&&(x<b)) {z=log(x)+cos(x);}
- else { z=tan(x); }
- printf("REZULTAT z = %f\n",z);
- }
- }
- else if (x<0) {
- if (x<a) {
- z=log(x)+sin(x);
- printf("ln(x) ne prenadlezhit oblasti znacheniya ot minus beskonechnosty do nulya z = %f\n",z);
- printf("%s. stroka-28 cod",Error_text);
- }
- }
- else if ((a<x)&&(x<b)) {
- z=log(x)+cos(x);
- printf("ln(x) ne prenadlezhit oblasti znacheniya ot minus beskonechnosty do nulya z = %f\n",z);
- printf("%s. stroka-35 cod",Error_text);
- }
- else {
- z=tan(x);
- printf("REZULTAT z = %f\n",z);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment