Last active
July 9, 2018 13:51
-
-
Save Eeyore741/f56bafe0f8804fa388ff9a63ddd60c24 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func pineappleCountForRussian(count: UInt) -> String{ | |
if (count == 0) return "У Джона нет ананасов" | |
if (count % 10 == 1 | |
&& | |
count % 100 != 11) { | |
return String.init(format: "У Джона %u ананас", count) | |
} | |
else | |
if ((count % 10 >= 2 && count % 10 <= 4) | |
&& | |
!(count % 100 >= 12 && count % 100 <= 14)) { | |
return String.init(format: "У Джона %u ананаса", count) | |
} | |
else | |
if (count % 10 == 0 | |
|| | |
(count % 10 >= 5 && count % 10 <= 9) | |
|| | |
(count % 100 >= 11 && count % 100 <= 14)) { | |
return String.init(format: "У Джона %u ананасов", count) | |
} | |
return "Oops!"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment