当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3546:Calculator

题目描述
Golden Adobe is the most advanced computer for scientific computing in the world. Unfortunately, it broke down. Your task is to write a super computing software to take its place. The software contains 10 registers named from A to J. There are three operations on the registers:
1) Assignment: X=Y
2) Addition: X+=Y
3) Multiplication: X*=Y
Notice that X and Y are two registers, and they may be the same.
Initially, all the registers are stored by integer 1. Your program should operate several operations and output the final result for 10 registers. You may assume that the length of each decimal number stored in the register is no longer than 5000.
输入解释
The input contains only one test case including several lines.
Each line contains an operation to be calculated.
The number of operations will no more than 300000.
输出解释
The output should contains exactly 10 lines, each line contains an integer denoting the decimal number in the register. See sample test case for further details.
输入样例
A+=B
A*=A
A+=A
B+=A
C+=B
D=B
输出样例
8
9
10
9
1
1
1
1
1
1
来自杭电HDUOJ的附加信息
Author HyperHexagon
Recommend zhengfeng

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3546

最后修改于 2020-10-25T23:04:37+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/2000MS(Java/Others) 65535/32768K(Java/Others)