verily phone 面经
发表于 : 周二 3月 07, 2023 1:16 am
四则运算
String keypressed(char c)
Example: when a user enters “1 + 3 + 6 =”, the keyPressed function is called 6 times:
keyPressed(‘1’) returns “1”
keyPressed(‘+’) returns “1”
keyPressed(‘3’) returns “3”
keyPressed(‘+’) returns “4” (which is the result of 1 + 3)
keyPressed(‘6’) returns “6”
keyPressed(‘=’) returns “10”
String keypressed(char c)
Example: when a user enters “1 + 3 + 6 =”, the keyPressed function is called 6 times:
keyPressed(‘1’) returns “1”
keyPressed(‘+’) returns “1”
keyPressed(‘3’) returns “3”
keyPressed(‘+’) returns “4” (which is the result of 1 + 3)
keyPressed(‘6’) returns “6”
keyPressed(‘=’) returns “10”