+ 8
[đ Challenge đ] Math Operation From String
If I've got a string that is a mathematic equation and I want to split it and calculate it how can we do it. If i get the input as 1+2*3,i know how to convert the string 1,2,3 to Integer.but i don't know how to covert +,* from string type to operator. ex. :- String str = "5-7+88*3%9-(77+55)";
6 Respostas
+ 5
@Happy MaCwAn đ¶ I'm not cracking jokes here đ¶
+ 9
@Kartikey Sahu..
alert(eval(prompt())) //js đ
Only c++, java & c
+ 4
print(eval(input())) //Pythonđ
0
ok.....heres the most detailed STEp BY STEP EXPLAINED VERSION....
GIVE ANY INPUT...
eg...4*78-34+5.9/6
works with ^ - + Ă· Ă these 5 operators...but prints all step cacuations
https://code.sololearn.com/cbEt2Rn86C5l/?ref=app
- 1
lol