最后一個(gè)表達(dá)式倒是-3還是=3
y=-7x³+3(x<0).
#include<stdio.h>
//#include<math.h>/*如果三次方直接寫成乘號(hào)的話就不用這個(gè)*/
int main()
{
double x , y;
printf("Please input the value of x:");
scanf("%f" , &x );
if( x > 0 )
y = 2*x+1;
else if ( x == 0 )
y = 10;
else if( x < 0 )
y = 7*x*x*x +3 ;
else
printf("The x is unknown!\n");
return 0;
}