SHARE
TWEET

14

a guest Dec 8th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Text.RegularExpressions;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace TFYA_lab14
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             string pattern = @"\b\d+[A-F]*((\d*)|([A-F]*))*\b";
  15.             Console.WriteLine("Введите шеснадцатиричное число");
  16.             string number = Console.ReadLine();
  17.             if(Regex.IsMatch(number,pattern,RegexOptions.IgnoreCase))
  18.             {
  19.                 Console.WriteLine("Число введено верно");
  20.             }
  21.             else
  22.             {
  23.                 Console.WriteLine("Число введено неверно");
  24.             }
  25.         }
  26.     }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top