#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)*/
>> 本文固定链接: https://www.vcgood.com/archives/2434
