From 7eda2d71ff6d3e2cca045d221d5ad7a42567388e Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Mon, 29 Mar 2021 19:06:13 -0500 Subject: [PATCH] Initial Commit --- 2020-09-26/fizz_buzz/.gitignore | 1 + 2020-09-26/fizz_buzz/Cargo.lock | 5 +++++ 2020-09-26/fizz_buzz/Cargo.toml | 9 +++++++++ 2020-09-26/fizz_buzz/src/main.rs | 13 +++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 2020-09-26/fizz_buzz/.gitignore create mode 100644 2020-09-26/fizz_buzz/Cargo.lock create mode 100644 2020-09-26/fizz_buzz/Cargo.toml create mode 100644 2020-09-26/fizz_buzz/src/main.rs diff --git a/2020-09-26/fizz_buzz/.gitignore b/2020-09-26/fizz_buzz/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/2020-09-26/fizz_buzz/.gitignore @@ -0,0 +1 @@ +/target diff --git a/2020-09-26/fizz_buzz/Cargo.lock b/2020-09-26/fizz_buzz/Cargo.lock new file mode 100644 index 0000000..07071a5 --- /dev/null +++ b/2020-09-26/fizz_buzz/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "fizz_buzz" +version = "0.1.0" diff --git a/2020-09-26/fizz_buzz/Cargo.toml b/2020-09-26/fizz_buzz/Cargo.toml new file mode 100644 index 0000000..010d412 --- /dev/null +++ b/2020-09-26/fizz_buzz/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "fizz_buzz" +version = "0.1.0" +authors = ["Rekai Musuka <--show>"] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/2020-09-26/fizz_buzz/src/main.rs b/2020-09-26/fizz_buzz/src/main.rs new file mode 100644 index 0000000..f835840 --- /dev/null +++ b/2020-09-26/fizz_buzz/src/main.rs @@ -0,0 +1,13 @@ +fn main() { + for n in 1..100 { + if n % 15 == 0 { + println!("FizzBuzz!") + } else if n % 5 == 0 { + println!("Buzz"); + } else if n % 3 == 0 { + println!("Fizz"); + } else { + println!("{}", n); + } + } +}