SHOW:
|
|
- or go back to the newest paste.
1 | using System; | |
2 | ||
3 | namespace C_sharp_Light | |
4 | { | |
5 | class Program | |
6 | { | |
7 | static void Main(string[] args) | |
8 | { | |
9 | string name, profession, cityResidence; | |
10 | - | uint age, weight, height, numberOfChangeResidence; |
10 | + | int age, weight, height, numberOfChangeResidence; |
11 | ||
12 | - | start: |
12 | + | |
13 | name = Console.ReadLine(); | |
14 | ||
15 | Console.Write("Вы работайте - "); | |
16 | profession = Console.ReadLine(); | |
17 | ||
18 | Console.Write("Вы живете в городе - "); | |
19 | cityResidence = Console.ReadLine(); | |
20 | ||
21 | ||
22 | Console.Write("Сколько вам лет? - "); | |
23 | age = Convert.ToInt32(Console.ReadLine()); | |
24 | - | if (!uint.TryParse(Console.ReadLine(), out age)) |
24 | + | |
25 | - | { |
25 | + | |
26 | - | ErrorInvalidInput("Ошибка. Ввод начнется с начала."); |
26 | + | weight = Convert.ToInt32(Console.ReadLine()); |
27 | - | goto start; |
27 | + | |
28 | - | } |
28 | + | |
29 | height = Convert.ToInt32(Console.ReadLine()); | |
30 | ||
31 | - | if (!uint.TryParse(Console.ReadLine(), out weight)) |
31 | + | Console.Write("Сколько раз вы переезжали ? - "); |
32 | - | { |
32 | + | numberOfChangeResidence = Convert.ToInt32(Console.ReadLine()); |
33 | - | ErrorInvalidInput("Ошибка. Ввод начнется с начала."); |
33 | + | |
34 | - | goto start; |
34 | + | |
35 | - | } |
35 | + | |
36 | $"Вам {age} лет.\n" + | |
37 | $"Рост - {height}.\n" + | |
38 | - | if (!uint.TryParse(Console.ReadLine(), out height)) |
38 | + | |
39 | - | { |
39 | + | |
40 | - | ErrorInvalidInput("Ошибка. Ввод начнется с начала."); |
40 | + | |
41 | - | goto start; |
41 | + | |
42 | - | } |
42 | + | |
43 | } |