input_file = ARGV[0] output_file = ARGV[1] f = open(input_file, "r") input = f.read f.close output_lines = "" for num in 1..input.to_i do if num.modulo(3) == 0 output_str = "Fizz" if num.modulo(5) == 0 output_str = "FizzBuzz" end elsif num.modulo(5) == 0 output_str = "Buzz" else output_str = num.to_s end output_line = output_str + "\n" output_lines += output_line end print(output_lines) f_w = open(output_file, "w") f_w.puts(output_lines) f_w.close