Cody

Problem 45412. Determina el número de cifras de un número

Solution 2190259

Submitted on 3 Apr 2020 by José Francisco Carreño Martínez
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x = 1000; y_correct = 4; assert(isequal(compute_number(x),y_correct))

y = 4

2   Pass
x = 0; y_correct = 1; assert(isequal(compute_number(x),y_correct))

y = 1

3   Pass
x = 7675483; y_correct = 7; assert(isequal(compute_number(x),y_correct))

y = 7

4   Pass
x=-2 y_correct = 1; assert(isequal(compute_number(x),y_correct))

x = -2 y = 1

5   Pass
x=8476352689256 y_correct = 13; assert(isequal(compute_number(x),y_correct))

x = 8.4764e+12 y = 13

Suggested Problems

More from this Author4

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!