From 94699362f2465ba373fd61d15398ffd74f429a51 Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Sat, 18 Jan 2025 00:31:16 +0000 Subject: [PATCH] solutions: 705A --- solutions/rust/705A.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 solutions/rust/705A.rs diff --git a/solutions/rust/705A.rs b/solutions/rust/705A.rs new file mode 100644 index 0000000..0cf98ec --- /dev/null +++ b/solutions/rust/705A.rs @@ -0,0 +1,20 @@ +use std::io; + +fn main() { + let mut s = String::new(); + io::stdin().read_line(&mut s).unwrap(); + + let n = s.trim().parse::().unwrap(); + + let mut words = String::from("I hate"); + + for i in 0..(n-1) { + if i % 2 == 0 { + words += &String::from(" that I love"); + } else { + words += &String::from(" that I hate"); + } + } + + println!("{} it", words); +}