/*
【项目3;多 分段函数求值】
标题:第八周项目3-多分段函数求值
问题及代码:
* Copyright (c) 2014, 烟台大学计算机学院
* All rights reserved.
* 文件名称:test.cpp
* 作 者: 刘斌
* 完成日期:2014年 10 月 19 日
* 版 本 号:v1.0
*。
* 问题描述:输入x,根据公式求值
* 输入描述:输入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<<endl;
return 0;
}