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 20051002020 at 2006-07-23 21:03:38 on Problem 1005
In Reply To:老大们,帮忙看一下,为什么每次的结果都一样 Posted by:20051002020 at 2006-07-23 19:49:56
> #include "stdio.h"
> #include "math.h"
> #define PI 3.1415
> int main()
> {
> 	int n,i,num=0;
> 	float x,y,s,r,a,b,c;
> 	a=0;b=0;
>     while(scanf("%d",&n)!=EOF)
> 		{scanf("%f %f",&x,&y);if(y<0)return 0;num++;
> 		 for(i=1;;i++)
> 			{s=i*100;r=sqrt(s/PI);c=sqrt((x-a)*(x-a)+(y-b)*(y-b));
> 			 if(c<r){printf("Property %d: This property will begin eroding in year %d.\n",num,i);break;}
> 			}n--;
> 		 if(n==0){printf("END OF OUTPUT");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