Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- TryToInt();
- }
- static int TryToInt()
- {
- string userInput;
- int number;
- do
- {
- Console.WriteLine("Введите число");
- userInput = Console.ReadLine();
- } while (!int.TryParse(userInput, out number));
- return number;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement