主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
专业课程
讨论区
兑换中心
登录
注册
发布
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
nicooy
2024年3月8日 10:38
翻转数的和 题解:用函数的简单解法
P1003
回复 0
|
赞 0
|
浏览 206
#include<iostream> #include<algorithm> #include<string> using namespace std; int main(){ string a,b; int c,d; while(cin>>a>>b){ reverse(a.begin(),a.end()); re...
查贝
2024年3月6日 15:00
翻转数的和 题解:
P1003
回复 0
|
赞 0
|
浏览 174
#include<stdio.h> #include<stdlib.h> /* 输入为多组测试数据,每行一组,包含两个整数A、B,两数中间以空格分隔 0<A<100 000 000,0<B<100 000 000 */ int reverse(int a){ int i,j,k,q,w,sw,bw,qw,temp=0; i=a%10,j=(a/10)%10,k=(a/100)%10,q=(a/1000)%10,w=(a/10000)%10,sw=(a...
fzh
2024年1月13日 21:08
翻转数的和 题解:C语言
P1003
回复 0
|
赞 0
|
浏览 431
#include<stdio.h> #include<math.h> //用于求翻转数 int GetVal(int x) { int data[9] = {0}; int top = -1; int result = 0; for (int i = 8; i >= 0; i--) { if (x / (int)pow...
Hegel
2023年3月17日 19:20
两翻转数的和
P1003
回复 0
|
赞 0
|
浏览 2.3k
#include <iostream> using namespace std; int Rev(int n){ int res =0; while(n>0){ res =res*10+n%10; n/=10; } return res; } int main() { int a,b; while(scanf("%d %d",&a,&b)!=EOF){ int s =Rev(a)+Rev(b); cout<<s<<endl; } return 0; } 注...
blackevil
2023年2月11日 09:41
运用字符串函数stoi直接转为整数再相加
P1003
回复 0
|
赞 1
|
浏览 2.8k
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int INF=1e9; int n=0; string a,b; int sum=0; vector<int> ve; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); &...
蒋黎明
2022年3月15日 18:51
字符串相加
P1003
回复 0
|
赞 0
|
浏览 4.6k
#include<iostream> #include<vector> #include<algorithm> #include <string> #include<cstdio> #include<cmath> using namespace std; int charToint(char c){ return static_cast<int>(c - '0'); } char intTochar(int i){ &...
Luoshu
2022年2月13日 14:35
翻转数
P1003
回复 0
|
赞 0
|
浏览 5.6k
#include<iostream> using namespace std; int fz(int number)//翻转数 { int temp=0; while(number!=0){ temp=temp*10+number%10; number=number/10; ...
我不是深井冰丶
2021年12月30日 18:27
大佬们麻烦看看我这个代码该怎么改
P1003
回复 3
|
赞 0
|
浏览 6.8k
#include <stdio.h> int main(){ while(1){ int i,A=0,B=0,C=0,D=0; scanf("%d%d",&A,&B); while(A!=0){  ...
江离
2021年6月15日 19:34
利用sscanf()实现
P1003
回复 0
|
赞 1
|
浏览 7.8k
#include <stdio.h> #include <string> #include <iostream> #include <algorithm> using namespace std; int main(){ int m,n; string s1,s2; while(cin>>s1>>s2){  ...
vf19
2021年1月6日 11:36
感谢c++答案的启发
P1003
回复 0
|
赞 0
|
浏览 9.6k
感谢之前c++答案的启发,不然我还在用数组去做。我好菜啊 还有不要把c++的万能头文件写上来,c通不过的 #include <stdio.h> #include <math.h> int fanzhuan(int n) { int fanzhuanshu=0; while(n!=0) { fanzhuanshu = n%10 + fanzhuanshu*10;  ...
1
2
3
4
题目
翻转数的和
题解数量
33
发布题解
热门题解
1
P1003 - 翻转数的和 - C
2
简洁~~,_(:ι」∠)_好饿,但是不想动
3
有点耍滑头,但是姑且能通过。
4
利用sscanf()实现
5
运用字符串函数stoi直接转为整数再相加
6
翻转数的和 题解:自用笔记
7
只包括函数和循环方法,比较前面两位较易懂因为我是大一学生语言较简单。
8
翻转数的和 题解:
9
翻转数的和 题解:
10
翻转数的和 题解: 实质就是拆分每个数