文章

246

粉丝

0

获赞

1202

访问

193.5k

头像
翻转数的和 题解:
P1003 兰州大学机试题
发布于 2026年1月
阅读数 884

#include<iostream>
#include<algorithm>
using namespace std;

int get(int x)
{
	string s=to_string(x);
	reverse(s.begin(),s.end());
	int res=0;
	for(int i=0;i<s.size();i++)
	{
		res=res*10+s[i]-'0';
	}
	return res;
}

int main()
{
	int a,b;
	while(cin>>a>>b)
	cout<<get(a)+get(b)<<endl;
	return 0;

}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发