Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

re~~~~~~

Posted by TN at 2005-04-24 12:27:36 on Problem 1005
In Reply To:Re:这题怎么没有要求呀? Posted by:SeaFrog at 2005-04-24 10:01:43
> #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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator