1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
#include <stdio.h>
#include <math.h>
int main()
{
char* name1[3][16];
float Lat1, Long1;
Long1>=-180 && Long1<=180, Lat1>=-90 && Lat1<=90;
scanf("%s %f %f", name1, &Lat1, &Long1);
char* name2[3][16];
float Lat2, Long2;
Long2>=-180 && Long2<=180, Lat2>=-90 && Lat2<=90;
scanf("%s %f %f", name2, &Lat2, &Long2);
char* name3[3][16];
float Lat3, Long3;
Long3>=-180 && Long3<=180, Lat3>=-90 && Lat3<=90;
scanf("%s %f %f", name3, &Lat3, &Long3);
float dist1, dist2;
dist1=sqrt((Lat2-Lat1)*(Lat2-Lat1)+(Long2-Long1)*(Long2-Long1));
dist2=sqrt((Lat3-Lat2)*(Lat3-Lat2)+(Long3-Long2)*(Long3-Long2));
if(dist1<dist2)
printf("%s", name3);
return 0;
}
|