#include
成都創(chuàng)新互聯(lián)公司主要從事成都網(wǎng)站設(shè)計(jì)、網(wǎng)站制作、外貿(mào)營(yíng)銷(xiāo)網(wǎng)站建設(shè)、網(wǎng)頁(yè)設(shè)計(jì)、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)珠暉,10多年網(wǎng)站建設(shè)經(jīng)驗(yàn),價(jià)格優(yōu)惠、服務(wù)專(zhuān)業(yè),歡迎來(lái)電咨詢(xún)建站服務(wù):18982081108
int?main()
{
int?x,y;
scanf("%d",x);
if(0xx10)?y=3*x+2;
else
{if(x=0)?y=0;
else
{if?(x0)?y=x*x;
else?printf("go?die\n");
}
}
printf("%d",y);
return?0;
}該程序的分段函數(shù)如下:
f(x)=3x+2? (0x10)
f(x)=1???????? (x=0)
f(x)?=?x*x??? (x0)
#include stdio.h
#include math.h
void main()
{
float x;
double y;
printf("Please input the value of x:");
scanf("%f",x);
if(x=-10x=4)
{
y=fabs(x-2);
printf("y=%.2f\n",y);
}
else if(x=5x=7)
{
y=x+10;
printf("y=%.2f\n",y);
}
else if(x=8x=12)
{
y=pow(x,4);
printf("y=%.2f\n",y);
}
else
printf("No answer\n");
}
#includestdio.h
void?main()
{?
float?x,y;
scanf("%f",x);
if(x0)
y=x*x;
else?if(x==0)
y=2*x-1;
else?
y=-3*x*x-1?;//這里少個(gè)分號(hào)
printf("%.2f",y);
}
#include stdio.h
#include math.h
double fun(double x)
{
if (x=0)return(-x+3);
else if(x1)return 1+x*x;
else ?return ?2*x+sqrt(x);
}
int main()
{
double x;
scanf("%lf",x);
printf("y=%lf \n",fun(x));
system("pause");
return 0;
}