Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Text.RegularExpressions;
- namespace ConsoleApplication3
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int counter = 0;
- string pattern = @"[A-Z]{5}[0-9]{4}[A-Z]";
- Regex regex = new Regex(pattern);
- List<string> output = new List<string>();
- do
- {
- string input = Console.ReadLine();
- if (regex.IsMatch(input) == true)
- {
- output.Add("YES");
- }
- else
- {
- output.Add("NO");
- }
- counter++;
- } while (counter < n);
- foreach (var item in output)
- {
- Console.WriteLine(item);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment