Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

简介的代码

Posted by 081416252 at 2018-10-08 23:43:06
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator