#include iostream
#include cmath
int main()
{
using namespace std;
cout"请输入x的值(x10):";
double x,y;
cinx;
int n;
n=1;
switch(n)
case 1:
y=log10(x);
break;
y=cos(x);
y=1.0/tan(x);
default:
cout"\n你输入的值不在取值范围内,再见!\n";
}
if(x10)
cout"\n本函数的y值为:"y".*^o^*\n";
return 0;
#includestdio.h
#includemath.h
void main()
float x,y;
scanf("%f",x);
else
y=x*x-x-1;
printf("%f",y);
#include?"stdio.h"
#include?"math.h"
int?main(int?argc,char?*argv[]){
double?x,y;
printf("Input?x(R:)...\nx=");
scanf("%lf",x);
printf("y?=?%g\t(x==%g)\n",y,x);
return?0;
运行样例:
#include
int?main()
int?x,y;
scanf("%d",x);
{if(x=0)?y=0;
{if?(x0)?y=x*x;
else?printf("go?die\n");
printf("%d",y);
}该程序的分段函数如下:
f(x)=1?? (x=0)
f(x)?=?x*x? (x0)
#include stdio.h
#include math.h
float x;
double y;
printf("Please input the value of x:");
y=x+10;
printf("No answer\n");
printf("please input x:");
printf("y=%f\n",y);
以上就是土嘎嘎小编为大家整理的分段函数用c语言怎么输相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!