Objective-C 习题(二)
Objective-C 练习题,题目来源 exercism.io,一共 50 题,见 GitHub。
第二篇共 10 题。
- # Raindrops
- # Grade School
- # Etl
- # Isogram
- # Flatten Array
- # Prime Factors
- # Sublist
- # Clock
- # Triangle
- # Robot Name
# Raindrops
题目和测试用例见链接,下同。 Raindrops
Convert a number to a string, the contents of which depend on the number’s factors.
1 | // Raindrops.h |
# Grade School
Grade School
Given students’ names along with the grade that they are in, create a roster for the school
1 | // GradeSchool.h |
# Etl
Etl
We are going to do theTransform
step of an Extract-Transform-Load.
1 | // Etl.h |
# Isogram
Isogram
Determine if a word or phrase is an isogram.
1 | // Isogram.h |
# Flatten Array
Flatten Array
Take a nested list and return a single list with all values except nil/null
1 | // FlattenArrayExample.h |
# Prime Factors
Prime Factors
Compute the prime factors of a given natural number.
1 | // PrimeFactors.h |
# Sublist
Sublist
Write a function to determine if a list is a sublist of another list.
1 | // SublistExample.h |
# Clock
Clock
Implement a clock that handles times without dates.
1 | // Clock.h |
# Triangle
Triangle
Determine if a triangle is equilateral, isosceles, or scalene.
1 | // Triangle.h |
# Robot Name
Robot Name
Manage robot factory settings.
1 | // Robot.h |