高精度减法要注意的是被减数必须必减数大,同时需要处理借位。方法类似于高精度加法。
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#define N 1001
using namespace std ;
int main ( )
{
int a [ N ] , b [ N ] , c [ N ] , i ;
char n [ N ] , n1 [ N ] , n2 [ N ] ;
memset ( a , 0 , sizeof (

本文介绍了如何在C++中进行高精度减法操作,特别强调了被减数必须大于减数,并详细说明了处理借位的技巧。内容包括与高精度加法、乘法和快速幂相关的模板实现。

1万+

被折叠的 条评论
为什么被折叠?



