How do you add?Larry is very bad at math — he usually uses a calculator, whichworked well throughout college. Unforunately, he is now struck...
分类:
其他好文 时间:
2015-07-27 10:49:09
阅读次数:
121
Implement a basic calculator to evaluate a simple expression string.The expression string contains onlynon-negativeintegers,+,-,*,/operators and empty...
分类:
其他好文 时间:
2015-07-23 13:43:59
阅读次数:
86
Implement a basic calculator to evaluate a simple expression string.The expression string may contain open(and closing parentheses), the plus+or minus...
分类:
其他好文 时间:
2015-07-23 13:35:37
阅读次数:
109
//// zyAppDelegate.h// Calculator//// Created by nimami on 15/7/20.// Copyright (c) 2015年 zhiyou. All rights reserved.//#import @interface zyAppDelega...
分类:
移动开发 时间:
2015-07-20 23:20:17
阅读次数:
130
Implement a basic calculator to evaluate a simple expression string.The expression string contains only non-negative integers, +, -, *, / operators and empty spaces . The integer division should trunca...
分类:
其他好文 时间:
2015-07-20 19:41:19
阅读次数:
111
所使用的算法:表达式求值(中缀表达式转后缀表达式,后缀表达式求值值)不如何设计接口,有时间来美化!MainActivity.javapackage com.example.calculator;import java.util.HashMap;import java.util.LinkedList;...
分类:
移动开发 时间:
2015-07-17 21:00:45
阅读次数:
153
//取vector作为一个栈,然后不断读取和pop。先把乘积或商算好再存入栈中
//ps.好久没有不参考别的直接自己写出AC代码了...各种bug...果然要好好练...
//1.考虑空格情况;2.考虑数位情况;3.考虑index的边界情况
class Solution {
public:
int calculate(string s) {
int len=s....
分类:
其他好文 时间:
2015-07-16 14:10:51
阅读次数:
104
问题描述Implement a basic calculator to evaluate a simple expression string.The expression string may contain open ( and closing parentheses ), the plus +...
分类:
其他好文 时间:
2015-07-15 14:36:25
阅读次数:
116
该题和前面的"
Basic Calculator
"的处理方法一样,只是加入了对"*"、"/"两种运算的支持。
class Solution {
public:
bool isnum(char c){
if(c >= '0' && c <= '9')
return true;
return false;
}
...
分类:
其他好文 时间:
2015-07-14 15:47:48
阅读次数:
111
该题的思路很明确就是将中缀表达式转换为后缀表达式,然后通过后缀表达式来求值。
class Solution {
public:
int calculate(string s) {
vector postorder;
stack ccache;
stack icache;
string tmp;
...
分类:
其他好文 时间:
2015-07-14 13:35:57
阅读次数:
83