POJ 1005

#include<iostream>
#include<math.h>
#define pi  3.1415926
using namespace std;
int main(){
  int N;
  double *px;
  double *py;
  double s_r;
  cin>>N;
  px=(double *)new double[N];
  py=(double *)new double[N];
  for(int s=0;s<N;s++){
      cin>>px[s];
      cin>>py[s];
  }
  int N1=N;
  for(int i=0;i<N;i++){
    
      s_r=sqrt(px[i]*px[i]+py[i]*py[i]);
      s_r=s_r*s_r*pi;
      s_r/=2;
  for(N1=1;50*(N1-1)<=s_r; N1++)
      if(50*N1>=s_r)
          cout<<"Property "<<i+1<<": This property will begin eroding in year "<<N1<<"."<<endl;
           
        
  }
  cout<<"END OF OUTPUT.";
  return 0;

}

关注我的公众号,当然,如果你对Java, Scala, Python等技术经验,以及编程日记,感兴趣的话。 

技术网站地址: vmfor.com

原文地址:https://www.cnblogs.com/gavinsp/p/4563197.html