上海交通大学2005-2007年计算机上机真题附答案(5)

本站小编 免费考研网/2016-08-04


three decimal digits X, Y, and Z., separated by a space, of the original
price $_XYZ_.

Output
For the input case, there may be more than one candidate for the original
price or there is none. In the latter case your program is to report 0.
Otherwise, if there is more than one candidate for the original price, the
program is to report the two faded digits and the maximum price per turkey
for the turkeys.

Sample input and output
Standard input standard output
72 3 2 511
6 7 9

5 9 5 18475
2 3 7

78 0
0 0 5


Problem B. Powerful Calculator
Input file: standard input
Output file: standard output

Today, facing the rapid development of business, SJTU recognizes that more
powerful calculator should be studied, developed and appeared in future
market shortly. SJTU now invites you attending such amazing research and
development work.
In most business applications, the top three useful calculation operators
are Addition (+), Subtraction (-) and Multiplication (×) between two given
integers. Normally, you may think it is just a piece of cake. However,
since some integers for calculation in business application may be very
big, such as the GDP of the whole world, the calculator becomes harder to
develop.
For example, if we have two integers 20 000 000 000 000 000 and 4 000 000
000 000 000, the exact results of addition, subtraction and multiplication
are:
20000000000000000 + 4000000000000000 = 24 000 000 000 000 000
20000000000000000 - 4000000000000000 = 16 000 000 000 000 000
20000000000000000 × 4000000000000000 = 80 000 000 000 000 000 000 000 000
000 000

Note: SJTU prefers the exact format of the results rather than the float
format or scientific remark format. For instance, we need
"24000000000000000" rather than 2.4×10^16.
As a programmer in SJTU, your current task is to develop a program to
obtain the exact results of the addition (a + b), subtraction (a - b) and
multiplication (a × b) between two given integers a and b.


Input
The input file consist of two separate lines where the first line gives the
integer a and the second gives b (|a| <10^200 and |b| < 10^200).

Output
For the input file, output three separate lines showing the exact results
of addition (a + b), subtraction (a - b) and multiplication (a × b) of
that case, one result per lines.

Sample input and output
Standard input standard output
20000000000000000 24000000000000000
4000000000000000 16000000000000000
80000000000000000000000000000000

Problem C. Sum of Factorials
Input file: standard input
Output file: standard output

John von Neumann, b. Dec. 28, 1903, d. Feb. 8, 1957, was a
Hungarian-American mathematician who made important contributions to the
foundations of mathematics, logic, quantum physics, meteorology, science,
computers, and game theory. He was noted for a phenomenal memory and the
speed with which he absorbed ideas and solved problems. In 1925 he received
a B.S. diploma in chemical engineering from Zurich Institute and in 1926 a
Ph.D. in mathematics from the University of Budapest, His Ph.D.
dissertation on set theory was an important contributions to the subject.
At the age of 20, von Neumann proposed a new definition of ordinal numbers
that was universally adopted. While still in his twenties, he made many


contributions in both pure and applied mathematics that established him as
a mathematician of unusual depth. His Mathematical Foundation of Quantum
Mechanics (1932) built a solid framework for the new scientific discipline.
During this time he also proved the mini-max theorem of GAME THEORY. He
gradually expanded his work in game theory, and with coauthor Oskar
Morgenstern he wrote Theory of Games and Economic Behavior (1944).
There are some numbers which can be expressed by the sum of factorials. For
example 9, 9 = 1! + 2! + 3! . Dr. von Neumann was very interested in such
numbers. So, he gives you a number n, and wants you to tell whether or not
the number can be expressed by the sum of some factorials.
Well, it is just a piece of case. For a given n, you will check if there
are some xi, and let n equal to
Σt (上标) i=1(下标) xi! (t≥1, xi≥0, xi = xj <==> i = j)
t
即 Σ xi! (t≥1, xi≥0, xi = xj <==> i = j)

相关话题/计算机

  • 领限时大额优惠券,享本站正版考研考试资料!
    大额优惠券
    优惠券领取后72小时内有效,10万种最新考研考试考证类电子打印资料任你选。涵盖全国500余所院校考研专业课、200多种职业资格考试、1100多种经典教材,产品类型包含电子书、题库、全套资料以及视频,无论您是考研复习、考证刷题,还是考前冲刺等,不同类型的产品可满足您学习上的不同需求。 ...
    本站小编 Free壹佰分学习网 2022-09-19
  • 2008年上海交通大学计算机考研复试上机试题
    本站小编 免费考研网 2016-08-04
  • 2016年东北大学计算机专业基础考研真题(完整版)
    2016年东北大学计算机专业基础考研真 题(完整版)凯程首发 一、简答 1、 循环语句while和dowhile的区别。 2、 有static声明的局部变量和自由变量的区别。 3、 根据 4、Int (*p)[4]和int *p[4]的区别 二、写出程序运行的结果 有一个是用指针作函数参数,实现数据的交换 有一个是a[9]={1, ...
    本站小编 免费考研网 2016-07-31
  • 2009-2015年计算机组成原理考研大题
    43.(8 分)某计算机的 CPU 主频为 500MHz,CPI 为 5(即执行每条指令平均需 5 个时钟周期)。假定某外设的数据传输率为 0.5MB/s,采用中断方式与主机进行数据传送,以 32 位为传输单位,对应的中断服务程序包含 18 条指令,中断服务的其他开销相当于 2 条指 令的执行时间。请回答下列问题,要求给出计算过程。 (1) ...
    本站小编 免费考研网 2016-07-31
  • 2009-2015年计算机组成原理考研选择题
    11.冯诺依曼计算机中指令和数据均以二进制形式存放在存储器中,CPU 区分它们的依据是 。 A.指令操作码的译码结果 B.指令和数据的寻址方式 C.指令周期的不同阶段 D.指令和数据所在的存储单元 11.C。考查指令的执行过程。 通常完成一条指令可分为取指阶段和执行 ...
    本站小编 免费考研网 2016-07-31
  • 计算机科学与技术考研报考注意事项
    计算机科学与技术考研报考注意事项 近几年由于专业的热门和考研竞争的异常激烈,因此国内一些重点院校的计算机专业硕士生入学分数都非常高,这种情况在一些重点院校特别突出。报考计算机专业研究生的朋友一定要充分地认清这种现实情况,做好充分的准备,思想上要树立考试胜利的信心,并且做好刻苦复习 ...
    本站小编 免费考研网 2016-07-27
  • 计算机科学与技术专业解析
    计算机科学与技术专业解析  一、培养目标   本专业培养和造就适应现代化建设需要。德智体全面发展、基础扎实、知识面宽、能力强、素质高具有创新精神,系统掌握计算机硬件、软件的基本理论与应用基本技能,具有较强的实践能力,能在企事业单位、政府机关、行政管理部门从事计算机技术研究和应用 ...
    本站小编 免费考研网 2016-07-27
  • 计算机软件与理论就业方向与就业前景
    计算机软件与理论就业方向与就业前景 计算机科学与技术专业介绍   计算机科学与技术是研究计算机的设计与制造,以及信息获取、表示、存储、处理、传输和利用等方面的理论、原则、方法和技术的学科。它包括科学与工程技术两方面,两者互为作用,高度融合,这是计算机科学与技术学科的突出特点。计 ...
    本站小编 免费考研网 2016-07-27
  • 计算机应用技术就业方向与就业前景
    计算机应用技术就业方向与就业前景 计算机应用技术专业介绍   计算机应用技术是计算机科学与技术专业下设的一个二级学科,某些院校可以授予理学学位,在此针对工学学位进行解析。本学科主要研究计算机各种应用中具有共性的理论、技术和方法,以及各种前沿性、创新性的计算机应用。   计算 ...
    本站小编 免费考研网 2016-07-27
  • 计算机系统结构就业方向与就业前景
    计算机系统结构就业方向与就业前景 计算机系统结构专业介绍   计算机系统结构是计算机科学与技术专业下设的二级学科。某些院校可以授予理学学位,在此针对工学学位进行解析。计算机系统结构是计算机的的机器语言程序员或编译程序编写者所看到的外特性。所谓外特性,就是计算机的概念性结构和功能 ...
    本站小编 免费考研网 2016-07-27
  • 北京邮电大学计算机学院简介
    北京邮电大学计算机学院简介 北京邮电大学计算机学院源于1985年9月成立的北京邮电大学计算机工程系,后经多次机构调整和更名,2008年9月由计算机科学与技术专业、网络工程专业、智能科学与技术专业和信息安全专业合并形成了现在的计算机学院。   计算机学院是全校规模大、综合实力强的 ...
    本站小编 免费考研网 2016-07-27