Advertisement
vasilivanov93

Untitled

Mar 15th, 2017
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 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 _02.IntegerInsertion
  8. {
  9. public class IntegerInsertion
  10. {
  11. public static void Main()
  12. {
  13. var list = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
  14.  
  15. var line = Console.ReadLine();
  16.  
  17. while (line != "end")
  18. {
  19. var firstDigit = line[0];
  20.  
  21.  
  22. list.Insert(int.Parse(firstDigit.ToString()), int.Parse(line));
  23.  
  24. line = Console.ReadLine();
  25. }
  26. Console.WriteLine(string.Join(" ", list));
  27.  
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement