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