2008
06-06

#include <stdio.h>
#include <math.h>
double f(float x)
{
 /**/
  double y;
  if(x<=0)
  y=(x+2)*exp(x);
  else
  y=(x+2)*log(2*x);


 /**/
}


void main()
{
  float x;
  double y;
  printf(“Please input a number:\n”);
  scanf(“%f”,&x);
  y = f(x);
  printf(“f(%.3f)=%.3f\n”,x,y);
  getch();
}
/*f(x)=(x+2)ln(2x)*/


留下一个回复