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:还是runtime error,郁闷,到底哪儿错了啊?

Posted by hawk at 2003-10-16 13:21:39 on Problem 1068
In Reply To:还是runtime error,郁闷,到底哪儿错了啊? Posted by:hoho at 2003-10-16 13:07:53
> #include<stdio.h>
> #include<stdlib.h>
> void convert(int *num,int n)
> {
> 	int k=0,*arr=(int *)malloc(n);
> 	char *brac=(char *)malloc(2*n);
> 	for(int i=1;i<=n;i++)
> 	{
> 		for(int j=1;j<=num[i]-num[i-1];j++)
> 			brac[k++]='(';

在某组数据下,这句中的k越界了,自己查查看吧
runtimeerror一般是数组越界的问题(如果没有其他很明显的原因)

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