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 |
我的ac code,可惜在timus上面却tle。。。#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator