#include <stdlib.h>
#include <math.h>
int main()
{
double x,y;
printf("Please input the Coordinate (x,y),whthout the brackets.\n");
if(scanf("%lf,%lf",&x,&y)!=2);
{
printf("Error input.\n\n");
system("pause");
return 1;
}
x=10-10*sqrt((fabs(x)-2)*(fabs(x)-2)+(fabs(y)-2)*(fabs(y)-2));
x<0&&(x=0);
printf("The Altitude is %g metres.\n\n",x);
system("pause");
return 0;
}
#include <math.h>
int main()
{
double x,y;
printf("Please input the Coordinate (x,y),whthout the brackets.\n");
if(scanf("%lf,%lf",&x,&y)!=2);
{
printf("Error input.\n\n");
system("pause");
return 1;
}
x=10-10*sqrt((fabs(x)-2)*(fabs(x)-2)+(fabs(y)-2)*(fabs(y)-2));
x<0&&(x=0);
printf("The Altitude is %g metres.\n\n",x);
system("pause");
return 0;
}