Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Collections.Generic;
- class MainClass
- {
- public static void Main (string[] args)
- {
- string chislo = @"(([1-9])\d*)";
- string pattern = $"({chislo}[-*+/])";
- string all_pattern = $"{pattern}*{chislo}";
- string str = Console.ReadLine();
- while(true)
- {
- foreach (Match match in Regex.Matches(str, all_pattern))
- Console.WriteLine(match.Value);
- str = Console.ReadLine();
- if (String.IsNullOrEmpty(str))
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement