Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

哪里的错?

Posted by gao128yuan at 2009-08-11 11:18:16
#include <iostream>
using namespace std;
int main(void)
{
	int m=0;
	int *p=new int[m];
        float l=1;
	float sum=0;
	while(l!=0)
	{
	    cin>>l;
            m++;
	    if(l==0)
		    m-=1;
	    else
		{
                     for(float i=2;sum<l;i++)
			 {
		             sum+=(1/i);
		             p[m-1]=i-1;
			 }
                      sum=0;
		}
	}
	for(int j=0;j<m;j++)
	{
		cout<<p[j]<<"cards(s)"<<endl;
	}
        return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator