| ||||||||||
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 |
直接就是数的翻转 一个翻转数函数就搞定了int renum(int n) { int rn=0; while(n) { rn=rn*10+n%10; n/=10; } return rn; } int main() { int n,cases,m; scanf("%d",&cases); while(cases--) { scanf("%d%d",&n,&m); printf("%d\n",renum(renum(n)+renum(m))); } return 0; } 不是为了炫耀代码,是看到有的人走弯路了. 何况是道水题. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator