[SPOJ] 大数竖式计算输出

该博客主要介绍了SPOJ平台上的一道题目,涉及大数的加减乘竖式计算。题目要求编写程序,根据输入的两个正整数和操作符(加、减、乘),按特定格式输出计算结果。对于加减法,数字需垂直排列,乘法则需逐位相乘并进行对齐。博客中还提供了输入输出示例及格式要求。
摘要由CSDN通过智能技术生成

      考输出整理和大数计算

      羞愧啊,,我看了测试数据 才一步步对上过的。。。。怎么说呢。。实在很不仔细,不会使用测试数据加强计算啊。。

      原题链接 点击打开链接



One part of the new WAP portal is also a calculator computing expressions with very long numbers. To make the output look better, the result is formated the same way as is it usually used with manual calculations.

Your task is to write the core part of this calculator. Given two numbers and the requested operation, you are to compute the result and print it in the form specified below. With addition and subtraction, the numbers are written below each other. Multiplication is a little bit more complex: first of all, we make a partial result for every digit of one of the numbers, and then sum the results together.

Input

There is a single positive integer T on the first line of input (equal to about 1000). It stands for the number of expressions to follow. Each expression consists of a single line containing a positive integer number, an operator (one of +- and *) and the second positive integer number. Every number has at most 500 digits. There are no spaces on the line. If the operation is subtraction, the second nu

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值