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:我去 都显示不出来结果 为啥就ac了腻 求大神 orz

Posted by ZAZUIMINGYUE at 2014-07-31 22:22:28 on Problem 2316
In Reply To:我去 都显示不出来结果 为啥就ac了腻 求大神 orz Posted by:ZAZUIMINGYUE at 2014-07-31 22:22:02
#include<stdio.h>
#include<string.h>

int main()
{
	int len, i;
	char a[10];
	int  b[10]={0};
	while( scanf("%s", a)!=EOF )
	{
		len = strlen(a);
		for(i=0; i<len; i++)
		{
			b[i] += a[i] - '0';
		}
	}
	for(i=0; i<len; i++)
		b[i] = b[i]%10;
	for(i=0; i<len; i++)
		printf("%d", b[i]);
	printf("\n");
	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