olah吧 关注:2贴子:143
  • 1回复贴,共1
#include <stdio.h>
#include <math.h>
int main()
{ float x,y,a,d,h,H=10;
scanf("%f,%f",&x,&y);
if (x>0,y>0) d=sqrt((x-2)*(x-2)+(y-2)*(y-2));
else if (x<0,y>0) d=sqrt((x+2)*(x-2)+(y-2)*(y-2));
else if (x<0,y<0) d=sqrt((x+2)*(x-2)+(y+2)*(y-2));
else if (x>0,y<0) d=sqrt((x-2)*(x-2)+(y+2)*(y-2));
else h=0;
a=d*H;
h=H-a;
printf("%d\n",h);
return 0;
}


IP属地:陕西1楼2013-04-20 19:31回复
    #include <stdio.h>
    #include <math.h>
    int main()
    {float x,y,X,Y;
    int H=10;
    scanf("%f,%f",&x,&y);
    X=fabs(x);
    Y=fabs(y);
    if(X<=3&&X>=1&&Y>=1&&Y<=3)H=10;
    else H=0;
    printf("%d\n",H);
    return 0;
    }


    IP属地:上海2楼2013-04-20 20:01
    回复