#include <iostream>
using namespace std;
#include <cmath>
int main()
{int x,y;
cout <<"请输入x";
cin >>x;
if (x<10)
{
if(x<6)
{
if(x<2)
y=x;
else
y=x*x;
}
else y=sqrt(x+1);
}
else y=1/(x+1);
cout << "y="<<y<< endl;
return 0;
}
求分段函数的值
最新推荐文章于 2022-10-11 19:43:04 发布