您的位置:首页 > 其它

hdu4554 西山居 叛逆的小明

2013-05-19 22:39 141 查看
题目 http://acm.hdu.edu.cn/showproblem.php?pid=4554

这个题目只要小心一点就可以了哦

具体ac代码

#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
int main()
{
int t,m,n;
__int64 a,b,x,y,s,s1;
while(cin>>t)
{
while(t--)
{
s=0,s1=0;
cin>>x>>y;

a=(x+y)/2;
b=x-a;

while(a)
{
m=a%10;
a=a/10;
s=10*s+m;
}
while(b)
{
n=b%10;
b=b/10;
s1=10*s1+n;
}

cout<<s+s1<<" "<<s-s1<<endl;
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: