当前位置:网站首页>Huawei machine test question: Martian computing JS
Huawei machine test question: Martian computing JS
2022-07-27 08:58:00 【Big chicken legs are best】
Title Description :
The known operators used by Martians are #、$, Its equivalent formula with earth man is as follows :
x#y = 2x+3y+4
x$y = 3*x+y+2
among x、y It's an unsigned integer
The earthman formula is based on C Language rule calculation
In the Martian formula ,$ Has a higher priority than #, The same operator , Calculate from left to right There is a string message of Martian , Please translate and calculate the result .
Input description :
Martian string expression ( Wrap without carriage return at the end )
** Description of the entered string : **
The string is only composed of unsigned integers and operators (#、$)
Calculation expression composed of . for example :123#45#6778
The use case guarantees that , There is no separator between operands and operators .
The use case guarantees that the value range of operands is 32 Bit unsigned integer .
Ensure that there is no integer overflow in the input and calculation results .
Ensure that the input string is a legal evaluation message , for example :123#45#6778
Ensure that there will be no illegal evaluation message , For example, a string like this :
#4$5 // miss operand
4$5# // miss operand
4#$5 // miss operand
4 $5 // The space
3+4-5*6/7 // There are other operators
12345678987654321$54321 //32 Bit integer calculation overflow
Output description :
Output the calculation result according to the input Martian string ( Wrap without carriage return at the end )
Example
Input :
7#6$5#12
Output :
226
explain :
7#6$5#12=7#(3*6+5+2)#12
=7#25
边栏推荐
- linux安装和远程连接mysql记录
- pollFirst(),pollLast(),peekFirst(),peekLast()
- Deep understanding of Kalman filter (2): one dimensional Kalman filter
- Encountered 7 file(s) that should have been pointers, but weren‘t
- Software testing function testing a full set of common interview questions [function testing - zero foundation] essential 4-1
- Sharing of four open source face recognition projects
- Blueprint class view method
- Flink1.15 source code reading Flink clients client execution process (reading is boring)
- 691. Cube IV
- 【微服务~Sentinel】Sentinel之dashboard控制面板
猜你喜欢

Aruba learning notes 10 security authentication portal authentication (web page configuration)

User management - restrictions
![[I2C reading mpu6050 of Renesas ra6m4 development board]](/img/1b/c991dd0d798edbb7410a1e16f3a323.png)
[I2C reading mpu6050 of Renesas ra6m4 development board]

"Weilai Cup" 2022 Niuke summer multi school training camp 1

被三星和台积电挤压的Intel终放下身段,为中国芯片定制芯片工艺

Arm system call exception assembly

The shelf life you filled in has been less than 10 days until now, and it is not allowed to publish. If the actual shelf life is more than 10 days, please truthfully fill in the production date and pu

NIO this.selector.select()

一些实用、常用、效率越来越高的 Kubernetes 别名

Network IO summary
随机推荐
Unity3d 2021 software installation package download and installation tutorial
4274. 后缀表达式
【nonebot2】几个简单的机器人模块(一言+彩虹屁+每日60s)
微信安装包从0.5M暴涨到260M,为什么我们的程序越来越大?
redis 网络IO
Is it safe to buy funds every day? Online and other answers
Arm undefined instruction exception assembly
Built in method of tensorflow model training and evaluation
接口测试工具-Jmeter压力测试使用
【微服务~Sentinel】Sentinel之dashboard控制面板
4278. Summit
User management - restrictions
“寻源到结算“与“采购到付款“两者有什么不同或相似之处?
微信安装包从0.5M暴涨到260M,为什么我们的程序越来越大?
Sequential storage and chain storage of stack implementation
linux安装和远程连接mysql记录
PyQt5快速开发与实战 4.1 QMainWindow
3311. 最长算术
Pyqt5 rapid development and practice 4.1 qmainwindow
PyTorch自定义CUDA算子教程与运行时间分析