Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text.RegularExpressions;
- namespace regex
- {
- class Program
- {
- static void Main(string[] args)
- {
- Regex R;
- string s;
- int counter = 0;
- string pattern = @"(^[0-6](TBX|TAX)\s((\d\d\d[1-9])|(\d\d[1-9]\d)|(\d[1-9]\d\d)|([1-9]\d\d\d))$)|^7(TBX|TAX|TEX)\s((\d\d\d[1-9])|(\d\d[1-9]\d)|(\d[1-9]\d\d)|([1-9]\d\d\d))$";
- int n = Int32.Parse(Console.ReadLine());
- for(int i = 0;i<n;i++)
- {
- s = Console.ReadLine();
- Match M = Regex.Match(s, pattern);
- if (M != Match.Empty)
- counter++;
- }
- Console.WriteLine(counter);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement