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 |
简介的代码#include <iostream> using namespace std; int f(int n){ int r,sum=0; while(n>0){ r=n%10; n=n/10; sum=sum*10+r; } return sum; } int main() { int n,a,b; cin>>n; while(n--){ cin>>a>>b; cout<<f(f(a)+f(b))<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator