Quipex

zadanie_3_XIII

Oct 11th, 2015
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. // Zadanie_3_XIII.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. #include <clocale>
  7. #include <math.h>
  8. using namespace std;
  9.  
  10. int _tmain(int argc, _TCHAR* argv[])
  11. {
  12.     setlocale(LC_CTYPE, "rus");
  13.     double a,y;
  14.     cout<<"Введите а:\n";
  15.     cin>>a;
  16.     if(a<-2)
  17.         y=(-5.0/3)*a-10.0/3;
  18.     else
  19.         if((a==-2)||(a==2))
  20.             y=0;
  21.         else
  22.             if((a>-2)&&(a<2))
  23.                 y=pow(4-a*a,1.0/2);
  24.             else
  25.                 if(a>2)
  26.                     y=(5.0/3)*a-10.0/3;
  27.                 else
  28.                     cout<<"debug";
  29.     cout<<"y:\n";
  30.     cout<<y; cout<<endl;
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment