一问题及代码
函数
#include <iostream.h>
#include <math.h>
void main()
{
double x,y;
cout<<"请输入数值x"<<endl;
cin>>x;
if(x<2)
{y=x;
cout<<"y="<<y<<endl;
}
else if(2<=x<6)
{y=pow(x,2)+1;
cout<<"y="<<y<<endl;
}
else if(6<=x<10)
{y=sqrt(x+1);
cout<<"y="<<y<<endl;
}
else
{double a;
a=x+1;
y=1/a;
cout<<"y="<<y<<endl;
}
}
二 运行结果
一· 问题及代码
#include<iostream>
using namespace std;
int main()
{
int a,b,c;
cou