- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n, idx,maxV=0;
- double sum=0;
- cin>>n;
- int x[n],y[n],r[n];
- for(int i=0;i<n;i++)
- {
- cin>>x[i]>>y[i]>>r[i];
- if(r[i]>maxV)
- {
- maxV=r[i];
- idx=i;
- }
- double area=r[i]*r[i]*3.14159;
- sum+=area;
- }
- printf("Sum = %.2f\n",sum);
- printf("x: %d, y: %d\n",x[idx],y[idx]);
- printf("radius: %d",maxV);
- return 0;
- }
複製代碼 |