Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::io;
- fn main() {
- println!("Hello, world!");
- let limit: i8;
- let mut input = String::new();
- io::stdin().read_line(&mut input).expect("Failed to read");
- limit = input.trim().parse::<i8>().expect("Invalid conv");
- println!("limit={}", limit);
- for x in 1..(limit+1) {
- if x%15 == 0 {
- println!("FizzBuzz");
- }
- else if x%5 == 0 {
- println!("Buzz");
- }
- else if x%3 == 0 {
- println!("Fizz");
- }
- else{
- println!("{}", x); //eww
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement