vi tri tuong doi cua M voi duong tron
/*vti tuuong doi cua m voi duong trona*/
#include<stdio.h>
#include<conio.h>
#include<math.h>
typedef struct
{
float x;
float y;
}diem;
float kc(diem A,diem B)
{
float a;
a=sqrt(pow((A.x-B.x),2)+pow((A.y-B.y),2));
return a;
}
int main()
{
float r;
diem O,M;
printf("nhap toa do diem tam O:");scanf("%f%f",&O.x,&O.y);
printf("nhap toa do diem M: ");scanf("%f%f",&M.x,&M.y);
printf("nhap ban kinh duong tron: ");scanf("%f",&r);
if((kc(O,M)<r)) printf("M nam trong duong tron");
if((kc(O,M)==r)) printf("M nam tren duong tron");
if((kc(O,M)>r)) printf("M nam ngoai duong tron");
getch();
return 0;
}
Bạn đang đọc truyện trên: AzTruyen.Top