hamaXD

59 3 no complete

Oct 9th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.70 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<math.h>
  4. typedef struct{
  5.     int x,y;
  6. }Point;
  7.  
  8. typedef struct{
  9.     int amount;
  10.     Point *points;
  11. }Path;
  12.  
  13. int main(){
  14.     Path p;
  15.     path_input(&p);
  16.     printf("Path Distance = %.2f\n",path_distance(&p));
  17.     path_clear(&p);
  18.     return 0;
  19. }
  20.  
  21. void path_input(Path *p){
  22.     int i,amount;
  23.     printf("point amount: ");
  24.     scanf("%d",p->amount);
  25.     for(i=0;i<amount;i++){
  26.         printf(" %2d.",i+1);
  27.     }  
  28. }
  29. void point_input(Point *p){
  30.     printf("(x,y):");
  31. }
  32. void path_clear(Path *p){
  33.    
  34. }
  35. float path_distance(Path *p){
  36.     int i;
  37.     float total = 0.0;
  38.    
  39.    
  40.     return total;
  41. }
  42.  
  43. float line_distance(Point *p1,Point *p2){
  44.     return sqrt(pow(p1->x - p2->x,2)+pow(p1->y  -p2->y,2));
  45. }
Advertisement
Add Comment
Please, Sign In to add comment