Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -1,14 +1,16 @@
// rust 0.8
// rust 0.11
fn main() {
for num in std::iter::range_inclusive(1, 100) {
println(
match (num % 3, num % 5) {
(0, 0) => ~"FizzBuzz",
(0, _) => ~"Fizz",
(_, 0) => ~"Buzz",
(_, _) => num.to_str()
}
);
for num in std::iter::range_inclusive(1i, 100) {
println!("{}", fizzbuzz(num))
}
}
fn fizzbuzz(num: int) -> String {
match (num % 3, num % 5) {
(0, 0) => format!("FizzBuzz"),
(0, _) => format!("Fizz"),
(_, 0) => format!("Buzz"),
(_, _) => format!("{}", num),
}
}