• 打印
  • 收藏
收藏成功
分享

一种C++中大数乘法程序


打开文本图片集

摘  要: 程序模拟了两数相乘的人工竖式算法,利用C++标准模板库中string类接收键盘输入的大数,并用标准模板库vector类存储大数和相乘,解决了基本数据类型表示大数位数有限的问题。

关键词: C++; 大数; string; vector

中图分类号:TP312          文献标识码:A     文章编号:1006-8228(2022)03-81-03

Abstract: The program simulates the artificial vertical calculation method of multiplication of two numbers, using the string class of C++ standard template library to receive the large number of keyboard input. The vector class of standard template library is used to store large numbers and multiply them, which solves the digits limiting problem for the basic data type to represent the large number.

Key words: C++; large number; string; vector

0 引言

随着科技的发展,计算机系统的性能越来越高,给人们的工作和生活带来了便利。(剩余3531字)

网站仅支持在线阅读(不支持PDF下载),如需保存文章,可以选择【打印】保存。

畅销排行榜
monitor