Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:这题怎么没有要求呀?In Reply To:这题怎么没有要求呀? Posted by:knuthocean at 2005-03-04 15:01:15 #include<fstream.h> #include<math.h> ifstream fin("1005.in"); ofstream fout("1005.out"); const double pi=3.14159; int n,ans[50]; double r,s; double x[50],y[50]; void init() { cin>>n; int f; for(f=1;f<=n;f++) { cin>>x[f]>>y[f]; }; }; void work() { int i,j; for(i=1;i<=n;i++) { s=sqrt(x[i]*x[i]+y[i]*y[i]);r=0;ans[i]=0; for(j=100;s>r;j+=100) { r=sqrt(j/pi);ans[i]++; }; }; }; void print() { int f; for(f=1;f<=n;f++) { cout<<"Property "<<f<<": This property will begin eroding in year "<<ans[f]<<'.'<<endl; }; cout<<"END OF OUTPUT."<<endl; }; int main() { init(); work(); print(); return 0; }; Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator