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 |
兄弟门,帮帮菜鸟啊,怎么wrong answer#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)<<" (cards)"<<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