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呢,求解,感激不尽为什么测试都过了,还是wrong answer呢,求解,感激不尽 #include<iostream> using namespace std; int main() { double s=0,c; int i=0; while ( cin>>c) { s=0; if(c>5.20||c<0.00 ) continue; if(c==0.00) break; if(c<=0.50) { s=1; cout<<s<<"cards"; continue; } for( i=2;s<c;i++) { s+=1.0/i; } cout<<i-2<<"cards"; } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator