Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- 02.
- #include<cmath>
- 03.
- using namespace std;
- 04.
- struct pct
- 05.
- {
- 06.
- int x,y;
- 07.
- };
- 08.
- void citire(pct&P)
- 09.
- {
- 10.
- cin>>P.x>>P.y;
- 11.
- }
- 12.
- int dist(pct P)
- 13.
- {
- 14.
- return P.x*P.x+P.y*P.y;
- 15.
- }
- 16.
- int main()
- 17.
- {
- 18.
- int n,k,pMax=-1;
- 19.
- pct A;
- 20.
- cin>>n;
- 21.
- for(int i=1;i<= n;i++)
- 22.
- {
- 23.
- citire(A);
- 24.
- int pd=dist(A);
- 25.
- if(pd>pMax)
- 26.
- pMax=pd,k=1;
- 27.
- else
- 28.
- if(pd==pMax)
- 29.
- k++;
- 30.
- }
- 31.
- cout<<sqrt(pMax)<<" "<<k;
- 32.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement