Advertisement
Guest User

Untitled

a guest
Feb 17th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. struct punct
  5. {
  6. int x,y;
  7. };
  8. punct v[101];
  9. int i,n,C;
  10. float D,dl;
  11. int main()
  12. {
  13. cin>>n;
  14. for (i=1;i<=n;i++)
  15. {
  16. cin>>v[i].x>>v[i].y;
  17. dl=sqrt(v[i].x*v[i].x+v[i].y*v[i].y);
  18. if(dl>D)
  19. {
  20. D=dl;
  21. C=1;
  22. }
  23. else
  24. if(D==dl)
  25. C++;
  26. }
  27. cout<<D<<" "<<C;
  28. return 0;
  29. }// #15 Draga Emi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement