Advertisement
Guest User

itz5410

a guest
Oct 22nd, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. //Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x86
  2.  
  3. #include <iostream>
  4. #include "math.h"
  5.  
  6.  
  7. using namespace std;
  8.  
  9. struct point {
  10. int x,y;
  11.  
  12. };
  13.  
  14. double func(point*y); double (point);
  15.  
  16. int main()
  17. {
  18.  
  19. point p1 = {0,0};
  20. p1.x = 7 ;
  21. point * ptr = &p1;
  22. ptr ->y = 100;
  23. double d = func(&p1);
  24. std::cout << d << "\n";
  25.  
  26.  
  27. };
  28. //ФУНКЦИЯ НАХОЖДЕНИЯ РАССТОЯНИЯ ТОЧКИ ОТ НАЧАЛА КООРДИНАТ
  29. double func(point * p)
  30. {
  31. return sqrt(p->x^2 + p->y^2);
  32. }
  33.  
  34.  
  35. double func(point a)
  36. {
  37. return sqrt(a->x^2 + a->y^2);
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement