Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- struct punct
- {
- int x,y;
- };
- punct v[101];
- int i,n,C;
- float D,dl;
- int main()
- {
- cin>>n;
- for (i=1;i<=n;i++)
- {
- cin>>v[i].x>>v[i].y;
- dl=sqrt(v[i].x*v[i].x+v[i].y*v[i].y);
- if(dl>D)
- {
- D=dl;
- C=1;
- }
- else
- if(D==dl)
- C++;
- }
- cout<<D<<" "<<C;
- return 0;
- }// #15 Draga Emi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement