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 code,可惜在timus上面却tle。。。

Posted by mccxj at 2006-04-06 01:59:52 on Problem 2602
#include <stdio.h>

int main()
{
	char a[1000000];
	char tmp;
	int i,j,n;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		getchar(); 
		scanf("%c %c",&a[i],&tmp);
		j=i;
		a[j]+=tmp-'0';
		while(a[j]>'9')
		{
			a[j]-=10;
			a[j-1]++;
			j--;
		}
	}
	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