Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading.Tasks;
- namespace Problem_8___Text_Gravity
- {
- class TextGravity
- {
- static void Main(string[] args)
- {
- int lengthMatrix = 10; //int.Parse(Console.ReadLine());
- string input = "The Milky Way is the galaxy that contains our star system";//Console.ReadLine();
- Console.WriteLine(input);
- int col = 0;
- for (int i = 0; i < input.Length; i++)
- {
- col = input.Length / 10 + 1;
- }
- char[,] inputToCharArray = new char[lengthMatrix, col];
- List<char> list = new List<char>();
- char x ;
- for (int i = 0; i < input.Length; i++)
- {
- x= input[i];
- foreach (var item in list)
- {
- list.Add(x);
- }
- }
- // Console.WriteLine(x);
- for (int p = 0; p < inputToCharArray.GetLength(0); p++)
- {
- for (int j = 0; j < inputToCharArray.GetLength(1); j++)
- {
- inputToCharArray[p, j] = ; // ей тука незнам какво да напиша
- Console.Write(inputToCharArray[p, j]);
- }
- Console.WriteLine();
- }
- }
- }
- }
- //string pattern = @"\s+"; // remuve empty spaces //Regex regex = new Regex(pattern);
- //string result = regex.Replace(input, "");
- //Console.WriteLine(result);
- //char[] inputToCharArray = input.ToCharArray(); // with char array
- //for (int i = 0; i < inputToCharArray.Length; i++)
- //{
- // char tempLetter = inputToCharArray[i];
- // if(inputToCharArray[i]==' ')
- // {
- // tempLetter = inputToCharArray[i+1];
- // Console.Write(tempLetter);
- // }
- //}
- // }
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement