June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -1,26 +1,20 @@
fn nth(num: i32) -> String {
fn nth(num: isize) -> String {
format!("{}{}", num, match (num % 10, num % 100) {
(1, 11) => "th",
(1, _) => "st",
(2, 12) => "th",
(2, _) => "nd",
(3, 13) => "th",
(3, _) => "rd",
_ => "th"
(1, 11) | (2, 12) | (3, 13) => "th",
(1, _) => "st",
(2, _) => "nd",
(3, _) => "rd",
_ => "th",
})
}
fn main() {
let ranges = vec![
(0, 26),
(250, 266),
(1000, 1026)
];
for &(s, e) in ranges.iter() {
let ranges = [(0, 26), (250, 266), (1000, 1026)];
for &(s, e) in &ranges {
println!("[{}, {}) :", s, e);
for i in s..e {
print!("{}, ", nth(i));
}
println!("");
println!();
}
}