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 |
Re:兄弟门,帮帮菜鸟啊,怎么wrong answerIn Reply To:兄弟门,帮帮菜鸟啊,怎么wrong answer Posted by:Tim at 2006-02-19 17:13:16 > #include<iostream> > using namespace std; > > int number(float f) > { > int i=1; > float s=0; > while(s<=f) > { > i++; > s+=1.0/i; > } > return i-1; > } > > int main() > { > int j=0,i=0; > float h; > while(1) > { > cin>>h; > if(h==0.00) > break; > cout<<number(h)<<" 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