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:急!为什么总是wrong anwser? 自己用例子测验是对的

Posted by 0908061148 at 2010-07-28 19:15:16 on Problem 1005
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;
> }

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