Problem 45252. Restricted Addition v1
Add two numbers without use of common arithmetic operations. Unfortunately, in order to enforce this restriction, other restrictions are imposed. For example, use of 'e' is restricted to prevent use of 'eval' functions.
Until the Cody test system is changed, the hack below will work (as it currently does on every Cody problem). However, this type of solution is not appreciated.
function ans = fileread(~), ''
Other hacks are appreciated. If you can circumvent the restrictions (with your code running when called by tests 2, 3, ...) to use addition, then you have a valid and welcomed solution.
This version of the problem does not require hacks at all, just some basic MATLAB creativity!
See also:
Solution Stats
Problem Comments
-
1 Comment
Rafael S.T. Vieira
on 13 Aug 2020
Restricting the usage of 'e' also means prohibiting the keyword 'end' in our code. Maybe you should change it to 'ev'.
Solution Comments
Show commentsProblem Recent Solvers18
Suggested Problems
-
Test if a Number is a Palindrome without using any String Operations
231 Solvers
-
Golomb's self-describing sequence (based on Euler 341)
159 Solvers
-
Calculate the hypotenuse of a right triangle without using ^ and sqrt ()
88 Solvers
-
特定の値がベクトル内に含まれているかを確認するコードを書こう
308 Solvers
-
10503 Solvers
More from this Author9
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!