Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Readline
- {
- class Program
- {
- static void ReadInt()
- {
- bool open = true;
- while (open==true)
- {
- Console.Write("Введите строку для перевода в int: ");
- string stroka = Console.ReadLine();
- int res;
- bool stgnum = Int32.TryParse(stroka,out res);
- if(stgnum==true)
- {
- Console.WriteLine(res);
- open = false;
- }
- }
- }
- static void Main(string[] args)
- {
- ReadInt();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment