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和我这个有什么区别 为什么我的过不了

Posted by wangfengtian at 2008-12-07 18:17:23 on Problem 2602
In Reply To:哈哈,勉强到了170MS,各位大侠帮看看咋还能更快的? Posted by:alawing at 2006-12-28 01:33:15
> #include<stdio.h>
int main()
{
	int n,i;
	char a[1000005],b[1000005];
	scanf("%d",&n);
	getchar();
	for(i=0;i<n;i++)
	{
		scanf("%c %c",a+i,b+i);
		getchar();
	}

	for(i=n-1;i>=0;i--)
	{
		a[i]=j+a[i]+b[i]-48;

		if(a[i]>57)
		{
			a[i-1]+=1;
			a[i]=a[i]-10;
		}
	
	}
	for(i=0;i<n;i++)
		printf("%c",a[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