由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 面试题求助
相关主题
Q in C/C++A面试题:50000html页中查找过期电话号码并替换的题
Java 笔试题one question about bit operator
一道题,我觉得挺难那个给个expression用RPN 来计算的面试题
请教一个面试题,在大量URL中找一个有wildcard的pattern最失败的一次onsite - bloomberg
Bloomberg C++ 软工面试题汇总搞不清C++里的constant expression
Google onsite今天面试的一道纯文字的面试题
大家看看这几道亚麻面试题怎么做?Expression evaluation在电面里面算啥难度的
请问一道很难的面试题amazon 电面
相关话题的讨论汇总
话题: let话题: mult话题: add话题: expression
进入JobHunting版参与讨论
1 (共1页)
Z**n
发帖数: 55
1
Write a calculator program in Java that evaluates expressions in a very
simple integer expression language. The program takes an input on the
command line, computes the result, and prints it to the console. For
example:
% java calculator.Main “mult(2, 2)”
4
Few more examples:
Input Output
add(1, 2) 3
add(1, mult(2, 3)) 7
mult(add(2, 2), div(9, 3)) 12
let(a, 5, add(a, a)) 10
let(a, 5, let(b, mult(a, 10), add(b, a))) 55
let(a, let(b, 10, add(b, b)), let(b, 20, add(a, b)) 40
An expression is one of the of the following:
•Numbers: integers between Integer.MIN_VALUE and Integer.MAX_VALUE
•Variables: strings of characters, where each character is one of a-z,
A-Z
•Arithmetic functions: add, sub, mult, div, each taking two arbitrary
expressions as arguments. In other words, each argument may be any of the
expressions on this list.
•A “let” operator for assigning values to variables:
let(, , )
Let这个功能 怎么实现比较好?
1 (共1页)
进入JobHunting版参与讨论
相关主题
amazon 电面Bloomberg C++ 软工面试题汇总
一道google 面试题Google onsite
请问大牛们关于Regular expression matching大家看看这几道亚麻面试题怎么做?
有基础面试题么请问一道很难的面试题
Q in C/C++A面试题:50000html页中查找过期电话号码并替换的题
Java 笔试题one question about bit operator
一道题,我觉得挺难那个给个expression用RPN 来计算的面试题
请教一个面试题,在大量URL中找一个有wildcard的pattern最失败的一次onsite - bloomberg
相关话题的讨论汇总
话题: let话题: mult话题: add话题: expression