编写题解 2841: 大整数加法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){ int maxmine = 210; int a[maxmine…… 题解列表 2023年02月02日 0 点赞 0 评论 219 浏览 评分:0.0
2841: 大整数加法 忽略前导0 摘要:## 大整数加法 ```c++ #include #include using namespace std; vector add(vectora,vectorb){ if(a.s…… 题解列表 2023年07月22日 0 点赞 0 评论 177 浏览 评分:0.0
大整数加法(C++) 摘要://大整数加法#include <bits/stdc++.h>using namespace std;int na[1005], nb[1005];string add(string a, strin…… 题解列表 2024年02月04日 0 点赞 0 评论 143 浏览 评分:0.0
编写题解 2841: 大整数加法 摘要:解题思路:求出最长字符串的长度,相加时只需让相加之后的答案位数多一位因为相同长度的数字相加最大只会向前进一位,如9+9=18,99+99=198.最后只需判断第一位是否为,零为0不打印,反之,打印。注…… 题解列表 2024年04月19日 0 点赞 0 评论 217 浏览 评分:0.0
详细解释我的代码这么写的原因 摘要:解题思路: 定义两个字符串数组a1\a2 和两个整数数组b1\b2 还有存放他们的和的整数数组sum , 并且将他们全部初始化为0, 将a1\a2里面的每一个数字 按照分位从大到小 分开存…… 题解列表 2024年11月23日 1 点赞 0 评论 275 浏览 评分:0.0
C语言:三个数组+两个函数 解决问题【豆包改过的代码】 摘要:解题思路:【原代码是我写的,现在这个代码是豆包改的,和我原本想法细节上有出入,我就不解释了,直接分享代码吧】注意事项:参考代码:#include <stdio.h>#include <…… 题解列表 2025年03月01日 0 点赞 0 评论 265 浏览 评分:0.0
大整数加法的双向链表写法 摘要:参考代码:#include<stdio.h> #include<stdlib.h> #include<string.h> struct lennum{ int num; struct l…… 题解列表 2023年11月22日 0 点赞 0 评论 105 浏览 评分:6.0
2841: 大整数加法 摘要:解题思路:模拟手算,将两数末尾对齐,自末端逐个相加,如有进位向高位进位注意事项:不要将前导0(即数字前有0)输出参考代码: #include <stdio.h>#include <stdlib.h>#…… 题解列表 2022年11月15日 0 点赞 0 评论 671 浏览 评分:9.9
大整数加法 摘要:解题思路:说白了,就是进位与ASCII码值的转换注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){ char a[10000]={&…… 题解列表 2022年11月19日 0 点赞 6 评论 657 浏览 评分:9.9
大整数加法(呃啊啊啊啊啊啊啊啊啊啊,搞了半天,原来是gets的原因,收取输入的时候不能用gets,为什么的话不太清楚,用指针递减去掉多余的0) 摘要:解题思路:先用两个字符串数组获得输入的值,再将字符串数组转化为int型数组,转化的原理是字符的ASCII码,这里使用了a[i] - '0'的方式,因为字符类型的数字和对应的ASCII码…… 题解列表 2023年10月19日 0 点赞 0 评论 161 浏览 评分:9.9