Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace test
- {
- class Program
- {
- static void Main(string[] args)
- {
- string value = "123456721332123312123";
- int kolkoChastiIksashDaIma = 11;
- int lenghtOfValue = value.Length;
- int firstIndexLemgth = lenghtOfValue / kolkoChastiIksashDaIma;
- int oneLenght = lenghtOfValue / kolkoChastiIksashDaIma;
- int lastIndexLenght = oneLenght + firstIndexLemgth;
- string newStr = "";
- int counter = 1;
- for (int i = 0; i < lenghtOfValue; i++)
- {
- if (counter == kolkoChastiIksashDaIma)
- {
- newStr += value[i];
- continue;
- }
- if (i==0)
- {
- newStr += value[i];
- continue;
- }
- if(i%firstIndexLemgth==0)
- {
- newStr +=" ";
- counter++;
- }
- newStr += value[i];
- }
- Console.WriteLine(newStr);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement