| ||||||||||
| 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 | |||||||||
大家帮我看一下1003题。我写的程序为什么不成功。希望指出错误//#include "stdafx.h"
#include<iostream>
using namespace std;
int main(int argc, char* argv[])
{
double r;
double n,sum=0;
cin>>r;
while(r!=0.00&&r>=0.01&&r<=5.20)
{
for(n=2;sum<r;n++)
sum=sum+1/n;
cout<<(n-2)<<endl;
cin>>r;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator