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

WHY???

Posted by tadx at 2004-06-05 15:19:07 on Problem 1519
#include <stdio.h>
void main()
{
	int num[5],r[20],i=0,j=0,b;
	char a[50],*p=a;
	while(1)
	{
		b=0;
		gets(a);
		if (a[0]=='0') break;
		while(*p!='\0')
		{
			b+=*p-'0';
			p++;
		}
		p=a;
		while(b>=10)
		{
			while(b>0)
			{
				num[i++]=b%10;
				b/=10;
			}
			for (b=0;i>0;i--) b+=num[i-1];
		}
		r[j++]=b;
	}
	for(i=0;i<j;i++) printf("%d\n",r[i]);
}

为什么runtime error?? 我已经失败N+1次了

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