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

为什么总是WA,我看不出来,帮帮忙!!!

Posted by 253430754 at 2007-02-10 17:55:37 on Problem 1005
#include<iostream>;
#include<iomanip>;
#include<math.h>;
using namespace std;
void work(float in[],int i)
{
	int count=0;
	float r;
	double pi=3.14159265358979;
	do
	{
		count++;
		r=(float)sqrt((float)(100*count/pi));
	}while(r<in[i]||r<in[i+1]);
	//output
	cout<<"Property "<<i/2+1<<": "<<"This property will begin eroding in year "<<count<<'.'<<endl;
}

void main()
{
	int i,x,y;
	float mj,in[100];
    //input
	i=0;
	cin>>in[i];
	i=1;
	while(in[0]>i/2)
	{
		cin>>in[i]>>in[i+1];
		i+=2;
	}
	//work
	for(i=1;in[i]>i/2;i+=2)
		work(in,i);
	cout<<"END OF OUTPUT.";
}

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