Advertisement
thienlang

Tinh Khoang cach

Jan 6th, 2015
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.22 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. struct ToaDo
  5. {
  6.     float x;
  7.     float y;
  8. };
  9.  
  10. float tinhKhoangCach ( ToaDo A, ToaDo B)
  11. {
  12.     float result = sqrt( (A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y));
  13.     return result;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement