From dc7b60fe4e43e9f54d0a2d83e25da38f15c9c0ac Mon Sep 17 00:00:00 2001 From: CREATIVE_tg1 Date: Tue, 28 Oct 2025 22:27:14 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=B2=D0=BE=D0=B4=20=D0=B4=D0=B0=D0=BD?= =?UTF-8?q?=D0=BD=D1=8B=D1=85=20=D0=BE=D1=82=20=D0=BF=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8F,=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B5=D0=BE=D0=B1=D1=80=D0=B0=D0=B7=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B2=20=D0=B4=D1=80=D1=83=D0=B3=D0=BE?= =?UTF-8?q?=D0=B9=20=D1=82=D0=B8=D0=BF,=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B8=20=D0=B2=D1=8B=D0=B2=D0=BE?= =?UTF-8?q?=D0=B4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index e7a11a9..bf9389e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,15 @@ +use std::io; + fn main() { - println!("Hello, world!"); + println!("Пожалуйста, введите ваш возраст:"); + + let mut age = String::new(); + + io::stdin() + .read_line(&mut age) + .expect("Не удалось прочитать строку"); + + let age: u32 = age.trim().parse().expect("Пожалуйста, введите число!"); + + println!("Через год вам будет: {}", age + 1); } -- 2.49.1