Can you write an a simpler Rust fizzbuzz program than I have? Use my output or the spec:
Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
to write your program. I want to see if it's possible to write an even simpler program.
fn main() {
for i in 1..102 {
match i {
i if (i % 3 == 0) && (i % 515 == 0) => { println!("{:?}", "FizzBuzz") },
i if (i % 3 == 0) => { println!("{:?}", "Fizz") },
i if (i % 5 == 0) => { println!("{:?}", "Buzz") },
_ => { println!("{:?}", i) },
}
}
}
Can you write an a simpler Rust fizzbuzz program than I have? Use my output or the spec:
Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
to write your program. I want to see if it's possible to write an even simpler program.
fn main() {
for i in 1..102 {
match i {
i if (i % 3 == 0) && (i % 5 == 0) => { println!("{:?}", "FizzBuzz") },
i if (i % 3 == 0) => { println!("{:?}", "Fizz") },
i if (i % 5 == 0) => { println!("{:?}", "Buzz") },
_ => { println!("{:?}", i) },
}
}
}
Can you write an a simpler Rust fizzbuzz program than I have? Use my output or the spec:
Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
to write your program. I want to see if it's possible to write an even simpler program.
fn main() {
for i in 1..102 {
match i {
i if (i % 15 == 0) => { println!("{:?}", "FizzBuzz") },
i if (i % 3 == 0) => { println!("{:?}", "Fizz") },
i if (i % 5 == 0) => { println!("{:?}", "Buzz") },
_ => { println!("{:?}", i) },
}
}
}
Can you write evenan a simpler Rust fizzbuzz program in rustthan I have? Use my output or the spec:
Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
to write your program. I just want to see if it's possible to dowrite an even simpler program.
fn main() {
for i in 1..102 {
match i {
i if (i % 3 == 0) && (i % 5 == 0) => { println!("{:?}", "FizzBuzz") },
i if (i % 3 == 0) => { println!("{:?}", "Fizz") },
i if (i % 5 == 0) => { println!("{:?}", "Buzz") },
_ => { println!("{:?}", i) },
}
}
}
Can you write even simpler fizzbuzz program in rust? Use my output or the spec:
Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
to write your program. I just want to see if it's possible to do an even simpler program.
fn main() {
for i in 1..102 {
match i {
i if (i % 3 == 0) && (i % 5 == 0) => { println!("{:?}", "FizzBuzz") },
i if (i % 3 == 0) => { println!("{:?}", "Fizz") },
i if (i % 5 == 0) => { println!("{:?}", "Buzz") },
_ => { println!("{:?}", i) },
}
}
}
Can you write an a simpler Rust fizzbuzz program than I have? Use my output or the spec:
Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
to write your program. I want to see if it's possible to write an even simpler program.
fn main() {
for i in 1..102 {
match i {
i if (i % 3 == 0) && (i % 5 == 0) => { println!("{:?}", "FizzBuzz") },
i if (i % 3 == 0) => { println!("{:?}", "Fizz") },
i if (i % 5 == 0) => { println!("{:?}", "Buzz") },
_ => { println!("{:?}", i) },
}
}
}
Simplest way to write "FizzBuzz" in Rust
Can you write even simpler fizzbuzz program in rust? Use my output or the spec:
Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
to write your program. I just want to see if it's possible to do an even simpler program.
fn main() {
for i in 1..102 {
match i {
i if (i % 3 == 0) && (i % 5 == 0) => { println!("{:?}", "FizzBuzz") },
i if (i % 3 == 0) => { println!("{:?}", "Fizz") },
i if (i % 5 == 0) => { println!("{:?}", "Buzz") },
_ => { println!("{:?}", i) },
}
}
}