Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region trololo
- using System;
- namespace TestProgram
- {
- class MyClass
- {
- static void Main ()
- {
- #endregion
- string [] notes;
- Console.WriteLine ( "Введите количество записок" );
- int notesCount = Convert.ToInt32 ( Console.ReadLine () );
- notes = new string [notesCount];
- for ( int i = 0 ; i < notes.Length ; i++ )
- {
- notes [i] = Console.ReadLine ();
- }
- Console.Clear ();
- Console.ForegroundColor = ConsoleColor.Green;
- for ( int i = 0 ; i < notes.Length ; i++ )
- {
- Console.WriteLine (notes[i].PadLeft(MaxLength(notes), '#') );
- }
- }
- static int MaxLength ( string [] arr )
- {
- string tempStr = arr [0];
- for ( int i = 0 ; i < arr.Length ; i++ )
- {
- if ( arr [i].Length < tempStr.Length )
- {
- }
- else
- tempStr = arr [i];
- }
- return tempStr.Length;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement