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

Re:自己机器上可以,在它那里就runtimeError

Posted by cyb88 at 2007-09-09 13:10:57 on Problem 1003
In Reply To:自己机器上可以,在它那里就runtimeError Posted by:jibimily at 2007-09-08 13:12:20
#include <iostream.h>

void main()
{
	int i = 0;
	int j = -1;
	int l;
	int k;
	float n = 0.00;
	float c[10];

	do{
		j++;
		cin >> c[j];
	}while(c[j]);

	for(k = 0; k <= j; k++)
	{
		for(l = 2; ; l++)
		{
			n += (float)1/l;
			if(c[k] <= n)
			{
				break;
			}
		}
		c[k] = (l-1);
		n = 0;
	}

	for(int m = 0; m <j; m++)
	{
		cout << c[m] << " card(s)" << endl;
	}
}
一样的,我也是runtime error, 我看你申请的动态内存怎么没有释放啊!

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