AddO1f

Lab3_2

Oct 11th, 2015
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "iostream"
  3. #include "iomanip"
  4. #include "math.h"
  5.  
  6. using namespace std;
  7.  
  8. int _tmain(int argc, _TCHAR* argv[])
  9. {
  10.     double x,y;
  11.     cout<<"Enter x="; cin>>x;
  12.     if ( (x > 0) && (x <= 3) )
  13.     {
  14.         y=x+1;
  15.         cout<<"y="<<y<<endl;
  16.     }
  17.     else if ( (x < 0) && (x >= -3) )
  18.     {
  19.         y=(-2*x/3);
  20.         cout<<"y="<<y<<endl;
  21.     }
  22.     else cout<<"Ne prinadlezhit\n"<<endl;
  23.     system("pause");
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment