For example:

List<int> list= new List<int>(); // Создали пустой список for(int i = 1; i <= 5; i++) // Заполняем от 1 до 5 включительно list.Add(i); MessageBox.Show(string.Join("", list)); // Выводит: 12345 for (int i = 0; i < 5; i++) // Хотим вставить 0 после каждого елемента list.Insert(i + 1, 0); MessageBox.Show(string.Join("", list)); // Выводит: 1000002345 

How to make it so that would 1020304050 ?

  • one
    Or from the end of the cycle to do, or step 2. - Alexander Petrov

1 answer 1

 for (int i = list.Count(); i > 0; i--) { list.Insert(i, 0); }