Cody

# Problem 933. Ordinal numbers

Solution 2715765

Submitted on 20 Jul 2020 by Jens Kjærgaard Boldsen
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
assert(isequal(ord(1),'1st'))

dig1 = 1 dig210 = logical 0 s = '1st'

2   Pass
assert(isequal(ord(2),'2nd'))

dig1 = 2 dig210 = logical 0 s = '2nd'

3   Pass
assert(isequal(ord(3),'3rd'))

dig1 = 3 dig210 = logical 0 s = '3rd'

4   Pass
assert(isequal(ord(4),'4th'))

dig1 = 4 dig210 = logical 0 s = '4th'

5   Pass
assert(isequal(ord(5),'5th'))

dig1 = 5 dig210 = logical 0 s = '5th'

6   Pass
assert(isequal(ord(10),'10th'))

dig1 = 0 dig210 = logical 1 s = '10th'

7   Pass
assert(isequal(ord(11),'11th'))

dig1 = 1 dig210 = logical 1 s = '11th'

8   Pass
assert(isequal(ord(12),'12th'))

dig1 = 2 dig210 = logical 1 s = '12th'

9   Pass
assert(isequal(ord(13),'13th'))

dig1 = 3 dig210 = logical 1 s = '13th'

10   Pass
assert(isequal(ord(14),'14th'))

dig1 = 4 dig210 = logical 1 s = '14th'

11   Pass
assert(isequal(ord(15),'15th'))

dig1 = 5 dig210 = logical 1 s = '15th'

12   Pass
assert(isequal(ord(82),'82nd'))

dig1 = 2 dig210 = logical 0 s = '82nd'

13   Pass
assert(isequal(ord(126),'126th'))

dig1 = 6 dig210 = logical 0 s = '126th'

14   Pass
assert(isequal(ord(911),'911th'))

dig1 = 1 dig210 = logical 1 s = '911th'

15   Pass
assert(isequal(ord(2012),'2012th'))

dig1 = 2 dig210 = logical 1 s = '2012th'

16   Pass
assert(isequal(ord(4077),'4077th'))

dig1 = 7 dig210 = logical 0 s = '4077th'

17   Pass
assert(isequal(ord(0),'0th'))

dig1 = 0 dig210 = logical 0 s = '0th'

18   Pass
assert(isequal(ord(-101),'-101st'))

dig1 = 1 dig210 = logical 0 s = '-101st'

### Community Treasure Hunt

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

Start Hunting!