| ||||||||||
| 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 | |||||||||
是不是cout<<answer[i]后面少个空格?In Reply To:求教 Posted by:bjtu_huanglu at 2007-01-18 12:34:51 > 我刚刚上北大acm不久,现在做Problem1003。下面是我的程序:
> #include <iostream>
> #include <vector>
> using namespace std;
> float overhang(float length)
> {
> float sum=0;
> float n=2;
> while(1)
> {
> sum=sum+1/n;
> if(sum>=length)
> {
> return n;
> }
> n++;
> }
>
> }
> int main()
> {
> vector<int>answer;
> float c;
> cin>>c;
> while(c!=0)
> {
> if(c>0.01&&c<5.20)
> {
> answer.push_back((int)overhang(c)-1);
> cin>>c;
> }
> }
> for(int i=0;i<answer.size();i++)
> cout<<answer[i]<<"card(s)"<<endl;
> return 0;
> }
> 每次提交,它都说是Presentation Error。
> 我郁闷了!
> 请各位帮帮忙!!!
> 谢谢!
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator