This commit is contained in:
DavidOnTop 2024-12-06 09:02:32 +01:00
parent b865ea307e
commit bb1d880a4f
No known key found for this signature in database
GPG key ID: 5D05538A45D5149F

View file

@ -1 +1,28 @@
pub fn main() {} pub fn main() {
let mut input = String::new();
std::io::stdin().read_line(&mut input).unwrap();
let a: i128 = input.trim().parse().unwrap();
input.clear();
std::io::stdin().read_line(&mut input).unwrap();
let b: i128 = input.trim().parse().unwrap();
input.clear();
std::io::stdin().read_line(&mut input).unwrap();
let op = input.trim();
match op {
"p" | "parne" => {
let a = if a % 2 == 0 {a} else {a+1};
for i in (a..=b).step_by(2) {
print!("{} ", i);
}
},
"n" | "neparne" => {
let a = if a % 2 == 1 {a} else {a+1};
for i in (a..=b).step_by(2) {
print!("{} ", i);
}
}
_ => panic!("Invalid operation"),
}
}