【问题描述】
编写程序实现两个超长正整数(每个最长80位数字)的减法运算。
【输入形式】
从键盘读入两个整数,要考虑输入高位可能为0的情况(如00083)。
1. 第一行是超长正整数A;
2. 第二行是超长正整数B;
【输出形式】
输出只有一行,是长整数A减去长整数B的运算结果,从高到低依次输出各位数字。要求:若结果为0,则只输出一个0;否则输出的结果的最高位不能为0,并且各位数字紧密输出。
【输入样例】
234098
134098703578230056
【输出样例】
-134098703577995958
【样例说明】
进行两个正整数减法运算, 234098 -134098703578230056 = -134098703577995958。-Problem Descr iption]
Write a program to achieve two long integer (each up to 80 digits) subtraction.
[Input form]
Reading from the keyboard into two integers, may want to consider a high input is zero (eg 00083).
1 The first line is a long integer A
(2) The second line is the long integer B
[Output] form
Output only one line, is a long integer A B minus the long integer arithmetic result, the output of the digits in descending order. Requirements: If the result is 0, only outputs a 0 highest level otherwise the output result can not be 0, and you close the digital output.
[Sample input]
234,098
134098703578230056
Sample output]
-134098703577995958
[Sample Descr iption]
Be two positive integers subtraction, 234,098-134098703578230056 =-134098703577995958.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
huoyig/
huoyig/Debug/
huoyig/Debug/huoyig.exe
huoyig/Debug/huoyig.ilk
huoyig/Debug/huoyig.pch
huoyig/Debug/huoyig.pdb
huoyig/Debug/huoying.exe
huoyig/Debug/huoying.ilk
huoyig/Debug/huoying.obj
huoyig/Debug/huoying.pch
huoyig/Debug/huoying.pdb
huoyig/Debug/vc60.idb
huoyig/Debug/vc60.pdb
huoyig/huoyig.dsp
huoyig/huoyig.dsw
huoyig/huoyig.ncb
huoyig/huoyig.plg
huoyig/huoying.dsp
huoyig/huoying.dsw
huoyig/huoying.ncb
huoyig/huoying.opt
huoyig/huoying.plg
huoyig/subtract.c