這是我的程式碼
跑出來答案都對
丟上去會Wrong Answer
請高人指點一下
// 713 Adding Reversed Numbers
// Date: 2007/9/17
#include<iostream>
using namespace std;
//reverse number function
int RevNum(int num)
{
int r=0;
while(num>0)
{
r=(r*10)+(num%10);
num=num/10;
}
return r;
}
int main()
{
long long int n,num,num1,num2;
long long int ans[200]={0};
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>num1>>num2;
num1=RevNum(num1);
num2=RevNum(num2);
num=num1+num2;
num=RevNum(num);
ans[i]=num;
}
for(int j=1;j<=n;j++)
{
cout<<ans[j]<<endl;
}
return 0;
}