Advertisement
Infiniti_Inter

15 I

Nov 2nd, 2019
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 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. using System.Text.RegularExpressions;
  7. using System.IO;
  8.  
  9. namespace ConsoleApp1
  10. {
  11.  
  12.  
  13.     class Program
  14.     {
  15.         static void Main()
  16.         {
  17.             using (StreamReader input = new StreamReader("d:/input.txt"))
  18.             {
  19.                 using (StreamWriter output = new StreamWriter("d:/output.txt", false))
  20.                 {
  21.  
  22.                     var a = input.ReadLine().Split();
  23.                     var ans =   from u in a
  24.                                 where u.Length == 2 && int.Parse(u) > 0
  25.                                 select u;
  26.                     foreach (var v in ans)
  27.                         output.Write("-" + v + " ");
  28.                 }
  29.             }
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement