Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 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 variables
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. List<int> list = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
  15. string listString = Console.ReadLine();
  16. int index = 0;
  17. int number = 0;
  18.  
  19. while (listString != "end")
  20. {
  21. index = Convert.ToInt32( listString.Substring(0,1));
  22. list.Insert(index, Convert.ToInt32(listString));
  23. listString = Console.ReadLine();
  24. }
  25. Console.WriteLine(string.Join(" ", list));
  26. }
  27.  
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement