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

请教高手1519题我这样做为什么是错的?

Posted by hongye at 2006-10-06 12:07:22
#include<stdio.h>
#define M 100
int main()
{
	long s,m;
	int i=0,a[M],j;
	scanf("%d",&m);
	while(m!=0)
	{
		while(m>=10)
		{
			s=0;
			while(m>0)
			{
				s+=m%10;
				m=m/10;
			}
			m=s;
		}
		a[i++]=m;
		scanf("%d",&m);
	}
	for(j=0;j<i;j++)
		printf("%d\n",a[j]);
	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