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;
- namespace debbuger_new
- {
- public class StartUp
- {
- public static void Main(string[] args)
- {
- var command = Console.ReadLine().Trim();
- var startIndex = command.IndexOf('(');
- var endIndex = command.IndexOf(')');
- var degree = int.Parse(command.Substring(startIndex+1, endIndex-startIndex-1))%360;
- command = Console.ReadLine();
- var allLines = new List<StringBuilder>();
- while (!command.Equals("END"))
- {
- allLines.Add(new StringBuilder(command));
- command = Console.ReadLine();
- }
- var maxlenght = allLines.Select(p => p.Length).Max();
- switch (degree)
- {
- case 0:allLines.ForEach(Console.WriteLine);break;
- case 90:
- for (var i = 0; i < maxlenght; i++)
- {
- for (var j = allLines.Count-1; j >=0; j--)
- {
- try
- {
- Console.Write(allLines[j][i]);
- }
- catch (Exception)
- {
- Console.Write(" ");
- }
- }
- Console.WriteLine();
- }
- break;
- case 180:
- for (var i = allLines.Count-1; i >=0; i--)
- {
- Console.WriteLine(new string(' ',maxlenght-allLines[i].Length) +string.Join("",allLines[i].ToString().Reverse()));
- }
- break;
- case 270:
- for (var i = maxlenght-1; i >= 0; i--)
- {
- foreach (var t in allLines)
- {
- try
- {
- Console.Write(t[i]);
- }
- catch (Exception)
- {
- Console.Write(" ");
- }
- }
- Console.WriteLine();
- }
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement