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:急!为什么总是wrong anwser? 自己用例子测验是对的In Reply To:急!为什么总是wrong anwser? 自己用例子测验是对的 Posted by:zhudechuan at 2010-07-13 22:54:58 > #include<stdio.h> > #include<math.h> > #include<string.h> > int main() > { > int n,i,j; > double s=0,r; > double a[1000][2]; > const double pi=4.0*atan(1.0); > scanf("%d",&n); > for (i=0;i<n;i++) > for (j=0;j<2;j++) > scanf("%lf",&a[i][j]); > for (i=0;i<n;i++) > { > s=0; > for (j=1;;j++) > { > s+=50; > r=sqrt((s*2.0)/pi); > if (a[i][0]>=-r && a[i][0]<=r && a[i][1]<=r) {printf("Property %d: This property will begin eroding in year %d.\n",i+1,j);break;} > } > } > printf("END OF OUTPUT.、n"); > return 0; > } printf("END OF OUTPUT.、n");把\打成、了 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator