Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp2
  8. {
  9.     class Program
  10.     {
  11.         static string normalize(string r)
  12.         {
  13.             for (int j = 0; j < r.Length; j++)
  14.             {
  15.  
  16.                 if (Char.IsDigit(r, j) == false)
  17.                 {
  18.                     r = r.Remove(j, 1);
  19.                 }
  20.             }
  21.             if (r.Length == 11)
  22.             {
  23.                 return r.Remove(0,1) + '\n';
  24.             }
  25.             else
  26.             {
  27.                 return "495" + r + '\n';
  28.             }
  29.            
  30.         }
  31.         static void Main(string[] args)
  32.         {
  33.             string n = (Console.ReadLine());
  34.             string s = "";
  35.             string r;
  36.             for(int i = 0; i < 3; i++)
  37.             {
  38.                 r =  Console.ReadLine();
  39.                 Console.WriteLine(r + "{0}", (normalize(r) == normalize(n) ? "  YES" : "    NO"));  
  40.             }
  41.  
  42.             Console.Read();  
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement