鱼C论坛

 找回密码
 立即注册
查看: 2076|回复: 1

求助

[复制链接]
发表于 2019-3-25 20:12:22 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
To use C++ to implement

• School Method for Integer Addition and Karatsuba Algorithm for Integer Multiplication

• Integer Division
Your program takes one line as input. The input line contains three integers separated by spaces. Let the three integers be I1, I2, and B. I1 and I2 are both nonnegative integers up to 100 digits long (there are no leading 0s, except when the value itself is 0). B is I1 and I2’s base (B is from 2 to 10). 1 Your program should output the sum of I1 and I2, using the school method, then the product of I1 and I2, using the Karatsuba algorithm, and finally the ratio between I1 and I2 (rounded down). You are asked to come up with a way to perform this division. It’s not covered in lectures. I2 will not be 0.

The results should still use base B. Please separate the results using one space.

Sample input 1: 101 5 10 Sample output 1: 106 505 20 Sample input 2: 10 111 2 Sample output 2: 1001 1110 0 Sample input 3: 111 10 2 Sample output 2: 1001 1110 11

有大神会吗
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2019-4-1 01:05:11 | 显示全部楼层
能发中文吗
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-28 05:34

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表