PersonalCorpus 版 (精华区)

1233763 Big Guava ... 10013 Accepted
0:04.174 1372 2002/11/13 08:08:38.493

void main()
{
#ifndef ONLINE_JUDGE
    freopen("k:\\uva\\i10013","r",stdin);
    freopen("k:\\uva\\o10013","w",stdout);
#endif

    int i,j,k,t,n;
    char s[1000005];

    scanf("%d\n",&t);

    while (t--) {
        scanf("%d\n",&n);
        for (i=0;i<n;i++) {
            scanf("%d%d\n",&j,&k);
            s[i]=j+k+48;
        }
        for (i=n-1;i>0;i--) if (s[i]>57) { s[i]-=10; s[i-1]++; }
        s[n]=0;
        printf("%s\n",s);
        if (t) printf("\n");
    }
}
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.725毫秒