首页
DreamJudge
院校信息
专业题库
模拟考试
机试真题
上岸课程
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
zxjrheaven
2025年3月24日 19:59
数字反转 题解:暴力
P1276
回复 0
|
赞 0
|
浏览 56
#include <bits/stdc++.h> using namespace std; int main() { string m,n; while(cin>>m>>n) { int a=stoi(m); int b=stoi(n); &n...
jsd
2025年1月22日 14:03
数字反转 题解:STL大法好
P1276
回复 0
|
赞 2
|
浏览 316
#include<bits/stdc++.h> using namespace std; int main() { int m, n; while(cin>>m>>n) { int ans = m + n; string s1 = to_string(m); &...
huanghu
2024年3月24日 15:38
数字反转 题解:c++
P1276
回复 0
|
赞 0
|
浏览 672
#include <iostream> #include <vector> #include<string> #include<algorithm> using namespace std; int reverse(int n){ int sum = 0; int t = 1; while(n){ int remain = n%10; sum = sum*t + remain; n/=10; t*=10; } return sum; } int main(){ int...
小王桐学
2024年3月4日 16:31
数字反转 题解:C
P1276
回复 0
|
赞 2
|
浏览 622
#include <stdio.h> int Reverse(int n) { int m = 0; while(n) { m = m*10+n%10; n/=10; } return m; } int main() { int a,b; while(scanf("%d %d",&a,&b) != EOF) { int sum1 = a+b,sum2; sum2 = Reverse(a) + Reverse(b); if(Reverse(sum1) == sum2) p...
活着的传奇
2023年8月29日 10:36
数字反转 题解:
P1276
回复 0
|
赞 0
|
浏览 1.1k
#include<bits/stdc++.h> using namespace std; int fanzhuanshu(int n){ int s=0;int a; while(n>0){ a=n%10; s=s*10+a; n=n/10; } return s; } // 求反转数 int main(){ int a,b,c,d;int e,f; int s=0,y=0; while(cin>>a>>b){ c=fanzhuanshu(a); d=fanzhuanshu(b...
My_opt
2022年4月26日 17:22
c++
P1276
回复 0
|
赞 0
|
浏览 4.3k
#include <iostream> using namespace std; int a, b; int rev(int x) { int y = 0; for (; x; x /= 10) y = y * 10 + x % 10; return y; } int main() { while (cin >> a >> b) if (rev(a) + rev(b) == rev(a + b)) cout << a + b << endl; else puts("...
lljpwrs
2022年3月5日 16:31
根据题意反转即可
P1276
回复 0
|
赞 0
|
浏览 5.4k
#include <iostream> #include <cstdio> using namespace std; int reverse(int x){ int res = 0; while(x != 0){ res = res * 10 + x % 10; x /= 10; } return res; } int main(){ int x1, y1, res1; int x2, y2, res2; while(scanf("%...
minozhao
2021年7月4日 21:27
用string做他不香吗
P1276
回复 0
|
赞 0
|
浏览 7.6k
#include<iostream> #include<string> #include<algorithm> using namespace std; int main(){ int a, b; int r_of_sum, sum_of_r; string sa, sb, ssum; while(cin >> a){ cin >> b; r_of_sum = a + b; string tmp = to_string(...
sincerely_LM
2021年3月26日 21:51
利用栈
P1276
回复 0
|
赞 0
|
浏览 7.9k
#include <iostream> #include <bits/stdc++.h> using namespace std; int Reverse(int x); int main(int argc, char const *argv[]) { int a,b; while(cin>>a>>b) { if (Reverse(a+b)==Reverse(a)+Reverse(b)) { printf("%d\n",a+b); ...
maomaonihao
2020年3月9日 08:54
数字反转
P1276
回复 1
|
赞 1
|
浏览 10.4k
#include <iostream> using namespace std; int reverse(int n) { int res=0; while(n>0) { res=n%10+res*10; &nbs...
题目
数字反转
题解数量
10
发布题解
在线答疑
热门题解
1
数字反转 题解:STL大法好
2
数字反转 题解:C
3
数字反转
4
根据题意反转即可
5
数字反转 题解:暴力
6
用string做他不香吗
7
数字反转 题解:c++
8
数字反转 题解:
9
利用栈
10
c++