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 shengye_205 at 2007-08-16 18:38:37 on Problem 1008
In Reply To:Re:为啥运行时间总RUNTIME ERROR杂办阿? Posted by:nancy at 2007-05-26 08:49:47
> 
> Runtime Error一般都是非法访问内存(数组越界、访问空指针、堆栈溢出、递归层数太多)、做除#include<iostream.h>
#include<string.h>
void main()
{
	char b[20][9]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu"};
    char b1[20][9]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
	int n,x,y,z;
	cin>>n;
	char yue[20][9];
	int *d=new int[n];
	float *a=new float[n];
	int *c=new int[n];
	int *a1=new int[n];
	int *c1=new int[n];
	char yue1[20][9];
	for(int i=0;i<n;i++)
	{
		cin>>a[i]>>yue[i]>>c[i];
	}
	int zhi;
	for(i=0;i<n;i++)
	{
		for(int j=0;j<20;j++)
		{
			if(strcmp(yue[i],b[j])==0)
				y=j*20;
		}
		d[i]=int(a[i])+y+c[i]*365;
	}
	for(i=0;i<n;i++)
	{
		c1[i]=d[i]/260;
		a1[i]=(d[i]%260)%13+1;
		zhi=(d[i]%260)%20;
		strcpy(yue1[i],b1[zhi]);
	}
	cout<<n<<endl;
   for(i=0;i<n;i++)
	   cout<<a1[i]<<' '<<yue1[i]<<' '<<c1[i]<<endl;
}法时除以了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