Advertisement
Rodunskiy

Untitled

May 24th, 2023
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. class program
  2. {
  3.     static void Main(string[] args)
  4.     {
  5.         int number = Int32Converter();
  6.     }
  7.  
  8.     static int Int32Converter()
  9.     {
  10.         int timeNumber;
  11.         string userInput = string.Empty;
  12.  
  13.         while (!int.TryParse(userInput, out timeNumber))
  14.         {
  15.             Console.Write("Введите любое число:");
  16.             userInput = Console.ReadLine();
  17.  
  18.         }
  19.  
  20.         return timeNumber;
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement