Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Collections.Specialized;
- using System.Text;
- using System.Threading.Tasks;
- using System.Net;
- using System.Threading;
- namespace IMJunior
- {
- class Program
- {
- //public static string myNumber;
- static void Main(string[] args)
- {
- Console.WriteLine("Введите число");
- IntReterner();
- Console.WriteLine("Вы ввели число");
- }
- public static int IntReterner()
- {
- string myNumber = Console.ReadLine();
- int intParsed;
- bool result = int.TryParse(myNumber, out intParsed);
- while (!result)
- {
- Console.WriteLine("Это не число");
- myNumber = Console.ReadLine();
- result = int.TryParse(myNumber, out intParsed);
- }
- return intParsed;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement