| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re和我这个有什么区别 为什么我的过不了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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator