Advertisement
YavorGrancharov

String_Decryption(lambda)

Jul 20th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace String_Decryption
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             int[] skipped = Console.ReadLine()
  12.                 .Split(' ')
  13.                 .Select(int.Parse).ToArray();
  14.  
  15.             int[] input = Console.ReadLine()
  16.                 .Split(' ')
  17.                 .Select(int.Parse).ToArray();
  18.  
  19.             char converted = '\0';
  20.             string concat = string.Empty;
  21.  
  22.             foreach (var entry in input
  23.                 .Where(p => p >= 65 && p <= 90)
  24.                 .Skip(skipped[0])
  25.                 .Take(skipped[1])
  26.                 .ToArray())
  27.             {
  28.                 converted = Convert.ToChar(entry);
  29.                 concat += converted;
  30.             }
  31.             Console.WriteLine("{0}", concat);
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement