| ||||||||||
| 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 | |||||||||
为什么总是WA,我看不出来,帮帮忙!!!#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator