这题我觉得我写的应该没错,难受啊。求大佬帮忙。
#include<stdio.h>#include<math.h>
void main()
{
int x,y;
double z;
printf("please input the value of x and y:\n");
scanf("%d %d",&x,&y);
if(x>=0&&y>0)
{
z=((x*x+1)/(x*x+2))*y;
printf("z=%.2f\n",z);
}
else if(x>0&&y<=0)
{
z=(x-2)/(y*y+1);
printf("z=.2f\n",z);
}
else if(x<0)
{
z=x+y;
printf("z=%.2f\n",z);
}
else
{
printf("sorry!you are wrong!");
}
}