Решение на упр.01 задача 1 от Стоян Орозов
Резултати
- 1 точка от тестове
- 0 бонус точки
- 1 точка общо
- 0 успешни тест(а)
- 0 неуспешни тест(а)
Код
fn optimize_temperature(room_temp: i32, eco_mode_level: i32) -> i64 {
let temp: i64 = room_temp as i64;
if eco_mode_level > 2 {
temp - 3
} else {
temp + 1
}
}
fn main() {
let mut current_temp = 21;
current_temp = current_temp + 2;
let current_temp = optimize_temperature(current_temp, 3);
println!("{}", current_temp);
}
