10xi.cpp
来自「《C/C++程序设计导论(第二版)》一书的程序源文件」· C++ 代码 · 共 15 行
CPP
15 行
// BigInt.cpp Adds two Big Integers (20-digit integers)
#include <iostream.h>
const int NUMDIG = 20, NUMDIG2 = 21;
void SumBigInt (int x[ ], int y[ ], int sum[ ]);
void ReadBigInt (int b[ ]); // digit size of large integers
void main ()
{ int x[NUMDIG], y[NUMDIG], sum[NUMDIG2], n;
ReadBigInt (x);
ReadBigInt (y);
SumBigInt (x, y, sum); // sum two large integers
cout << "the sum is: ";
for (n=0; n<NUMDIG2; n++)
cout << sum[n];
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?