您的位置:首页 > 其它

poj 1504 水题

2017-04-09 16:32 176 查看
输入俩个数,将这两个数反转相加后再反转输出。

#include<iostream>
using namespace std;
int reversed(int a)
{
int b=0;
while(a)
{
b=b*10+a%10;
a=a/10;
}
return b;
}
int main()
{
int n;
int a,b,c;
cin>>n;
while(n--)
{
cin>>a>>b;
cout<<reversed(reversed(a)+reversed(b))<<endl;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  acm poj