首页
DreamJudge
院校信息
考研初试
机试真题
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
xiangyang
2023年3月14日 00:19
傻逼题目条件浪费时间
P1474
回复 1
|
赞 1
|
浏览 3.4k
//这题最傻逼的地方就是说好了位数相同的大数,他答案是让你考虑两个不同位数的加法,导致你们一直没法AC #include using namespace std; int a[1005]; int b[1005]; int c[1005]; int main() { string s,t; while(cin>>s>>t) { for(int ...
tuesdasy
2022年3月4日 15:00
C
P1474
回复 0
|
赞 1
|
浏览 5.2k
新手,轻喷 #include <stdio.h> #include <string.h> char a[1005]; char b[1005]; char c[1005]; void reverse (char * a, int len)//逆置 { for (int i = 0; i < len/2; i++) { char temp = a[i]; a[i] = a[len - i - 1]; a[len - i - 1] = temp; } } int addzero(ch...
James
2021年1月30日 13:22
大整数加法vector简洁代码
P1474
回复 0
|
赞 0
|
浏览 8.9k
#include<iostream> #include<vector> #include<string> #include<algorithm> #include<cstdio> #include<string.h> using namespace std; vector<int> add(vector<int>&A,vector<int>&B){ vector<int> C; &n...
鱼翔浅底
2021年1月27日 21:20
大整数加法(C)
P1474
回复 0
|
赞 0
|
浏览 8.2k
#include <stdio.h> #include <math.h> #include <stdlib.h> #include <string.h> typedef struct { char num[1001];//从低位到高位存储 int n;//有多少位 }BigInteger; //对调位置,使按低位到高位存储 void Reverse(BigInteger *BI) { char tmp; for (int i = 0; i < BI->...
老猫
2021年1月17日 16:06
简洁
P1474
回复 0
|
赞 0
|
浏览 9.4k
#include <bits/stdc++.h> using namespace std; int main() { string a,b; while(cin>>a>>b) { if(a.size()<b.size()) swap(a,b);//保证a最长 string c(a.size(),'0'); b.insert(0,a.size()-b.size(),'0'); int jinwei=0; for(int i=a.size()-1;i>=0;i--) { ...
mzymzyo
2020年3月15日 20:48
题解:大整数加法
P1474
回复 0
|
赞 2
|
浏览 10.9k
提供两种模拟加法的方法: (一般来说数组模拟效率更高) 1.用数组来模拟加法 #include<bits/stdc++.h> using namespace std; int a[1005], b[1005], c[1005];//c存答案 int main() { string A, B; while (cin >> A >> B) { //初始化 memset(a, 0, sizeof(a)); memset(b, 0, sizeof(a)); memset(c, 0, ...
1
2
3
题目
大整数加法
题解数量
26
发布题解
在线答疑
热门题解
1
大整数加法 题解:暴力水题
2
大整数加法 题解:c++
3
大整数加法 题解:C语言,用字符数组存储大数
4
见到大数相加或相乘,建议用java
5
大整数加法(大数问题py直接秒了) 题解:
6
大整数加法 题解:C语言只有50%
7
大整数加法 题解:struct内部写法
8
大整数加法 题解:c++版本
9
大整数加法 题解:求大佬帮忙看看,一直显示栈溢出错误 50%
10
大整数加法 题解:c++和python实现(python不存在取值范围问题,多大都能算,就是这么强大)