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:帮忙看一下,我自己测试是对的啊,可系统说我是错误答案。In Reply To:帮忙看一下,我自己测试是对的啊,可系统说我是错误答案。 Posted by:clx19871120 at 2007-06-16 19:41:48 > #include<iostream> > using namespace std; > int main(){ > double n; > double a[10]; > int i; > int p=0; > for(i=0;i<10;i++) > {cin>>a[i]; > if(a[i]==0.00) > break; > } > while(a[p]){ > double k=0; > for(n=1;k<a[p];n++){ > k+=1.00/(n+1); > } > cout<<n-1<<' '<<"card(s)"<<endl; > p++; > } > return 0; > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator