Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Study
- {
- class Program
- {
- static void Main(string[] args)
- {
- numberCheck();
- }
- static int numberCheck()
- {
- bool exit = true;
- int number = 0;
- while (exit == true)
- {
- Console.WriteLine("Введите строку:");
- string input = Console.ReadLine();
- bool result = int.TryParse(input, out number);
- if (result == true)
- {
- Console.WriteLine("Преобразование прошло успешно");
- exit = false;
- }
- }
- return number;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement