* copyright (c) 2014 , 烟台大学计算机学院
* all rights reserved .
* 文件名称 : textst . cpp
* 作者 : 孙旭明
* 完成日期 : 2014年10月18日
* 版本号 : v1.0
*
* 问题描述 : 多分段函数求值
* 输入描述 : 一 个整数 x
* 程序输出 : 对应的函数值y
*/
#include <iostream>
#include<cmath>
using namespace std;
int main()
{
double x,y;
cin >>x;
if (x<2)
y=x;
else if (x<6)
y=x*x+1;
else if (x<10)
y=sqrt(x+1);
else y=1/(x+1);
cout<<"y=" <<y<<endl;
return o;
}