Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text.RegularExpressions;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace TFYA_lab14
- {
- class Program
- {
- static void Main(string[] args)
- {
- string pattern = @"\b\d+[A-F]*((\d*)|([A-F]*))*\b";
- Console.WriteLine("Введите шеснадцатиричное число");
- string number = Console.ReadLine();
- if(Regex.IsMatch(number,pattern,RegexOptions.IgnoreCase))
- {
- Console.WriteLine("Число введено верно");
- }
- else
- {
- Console.WriteLine("Число введено неверно");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement