Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace CSLight
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int finalNumber = ReadInt();
- Console.WriteLine($"Конвертация вашего числа {finalNumber} из типа (string) прошла успешно. \n");
- }
- static int ReadInt()
- {
- int number = 0;
- while (int.TryParse(Console.ReadLine(), out number) == false)
- {
- Console.WriteLine("Не удалось сконвертировать число. \n");
- }
- return number;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement