//#include "stdafx.h"//In VC++6.0, with this line, please...
#include
#include "math.h"
using namespace std;
int main(void){
double x,y;
cout << "Input x(R:)...\nn=";
cin >> x;
y = x<0 ? 3*x*x-5/x : 0<=x && x<5 ? 1/(2+cos(x)) : sqrt(sin(x)+1);
cout << "y(" << x << ") = " << y << endl;
return 0;
}