/
ZVasilii
/
RustBookLearning
Обзор
Документация
Войти
/
ZVasilii
/
RustBookLearning
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
variables/src/main.rs
18 строк
450 B
vlzaytsev
Upload files
01 окт 2024, 23:22
01 окт 2024, 23:22
c2258e4
Код
Авторство
О чём код?
fn main() { let mut y = 5; println!("The value of y = {y}"); y = 6; println!("The value of y = {y}"); const SECONDS_IN_HOUR : u32 = 60 * 60 * 1; println!("Seconds in hour = {SECONDS_IN_HOUR}"); let x: i32 = 5; let x: i32 = x + 1; { let x = x * 2; //Shadowed variable live to the end of scope println!("The value of x in the inner scope is: {x}"); } println!("The value of x is: {x}"); }