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: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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator