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 |
为什么一直是错误,高手看一下!!#include<iostream> #include<vector> using namespace std; int main() { double a,b=0.5; vector<double> vnum; int num=0; cin>>a; while(a!=0.00){ while(b<a){ b=0; num++; for(double i=1;i<=num+1;++i){ b+=1/(i+1); } } vnum.push_back(num); cin>>a; num=0; } for(int j=0;j!=vnum.size();++j){ cout<<vnum[j]+1<<" card(s)"<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator