Aliendreamer

string encryption

Jul 17th, 2017
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 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 _02LinqMoreExcercisesStringEncryption
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int []commands = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
  14. int remove = commands[0];
  15. int take = commands[1];
  16.  
  17. List<int> numbers = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
  18. numbers.RemoveAll(x => x < 65);
  19. numbers.RemoveAll(x => x > 90);
  20. numbers.RemoveRange(0, remove);
  21. numbers.Take(take).ToList();
  22.  
  23. List<char>finalstring =numbers.ConvertAll(x => (char)x);
  24.  
  25. // finalstring.RemoveRange(0,remove);
  26. // finalstring.Take(take).ToList();
  27.  
  28. Console.WriteLine(string.Join("",finalstring));
  29.  
  30.  
  31.  
  32.  
  33.  
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment