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 |
感谢您~~~~In Reply To:感慨啊~~~~~~ Posted by:380757580 at 2008-08-23 17:20:52 //This is an use of string-reverse function. int i, j, k, t, T; char a[99], s[99]; main() { for(scanf("%d",&T);t++<T;printf("%d %s\n",t,strrev(s))){ for(j=2;j--;) for(scanf("%s",s),strrev(s),i=0;s[i];i++) a[i]+=s[i]-48; for(k=i=0;i<98;a[i++]=0){ a[i+1]+=a[i]/2; if(a[i]) k=i; s[i]=a[i]%2+48; } s[k+1]=0; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator