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