Problem 563. How to add?
- Imagine you are in 2222 Anno Domini, when everyone must learn how to add,
- and competing for the highly prestigious post of,
- Chief Comptroller of Dda Corporation.
- You are being tested via MATLAB Cody for addition of two positive integers X and Y,
- both are fortunately in decimal system, and only a few dozen digits or less,
- and delivered as ASCII strings.
- Please output the result Z in similar style.
- Please adopt a general strategy, as X and Y may be changed later.
- Please rename the function Z = dda(X,Y).
- Function Template:
function Z = dda(X,Y) X='98765432109876543210987654321098765432109876543210987654321' Y='98765432109876543210987654321098765432109876543210987654321' Z='197530864219753086421975308642197530864219753086421975308642'; end
Solution Stats
Problem Comments
-
2 Comments
赵思铭
on 28 Aug 2024
why I can't use sym to solve this problem
Dyuman Joshi
on 28 Aug 2024
@赵思铭, Cody only supports basic MATLAB. It does not support any Toolboxes. Thus, you can't use 'sym' which is a part of the Symbolic Math Toolbox.
This is officially mentioned in the "Notes" section on this page - https://in.mathworks.com/matlabcentral/content/cody/about.html
Solution Comments
Show commentsProblem Recent Solvers144
Suggested Problems
-
3661 Solvers
-
given 3 sides, find area of this triangle
797 Solvers
-
860 Solvers
-
Determine Whether an array is empty
775 Solvers
-
Unique values without using UNIQUE function
350 Solvers
More from this Author100
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!