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

AC了,可是我不知道如何解释他呀~~~~摆脱大牛冒个泡

Posted by Hen at 2007-01-23 16:45:51 on Problem 2316
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
char num[15];
char total[15];
int main()
{
	int i,len,temp;
         memset(total,0,sizeof(total));
	memset(num,0,sizeof(num));
    gets(total);    //如果没有这句话就WA~~~~可是我觉得没有什么区别呀?                    
    while(gets(num)!=0)
	{
		len=strlen(num);
		for(i=0;i<len;i++)
		{
			total[i]=(total[i]+num[i]-'0'-'0')%10+'0';
		}
		memset(num,0,sizeof(num));
	} 
	 	printf("%s",total);
    //getchar();
	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