Проблем със задача 2. Song Encryption от финалния изпит за Tech Module C# от декември 2018
Здравейте,
Прилагам решение на задачата, което съм направил и ми дава 70/100. Някой може ли да ми помогне и да ме насочи какво пропускам?Благодаря предварително.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace SongEncryption
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            while (input != "end")
            {
                if(Regex.Matches(input, @"[A-Z][a-z' ]+[:][A-Z ]+").Count==1 &&
                    Regex.Matches(input.Split(':')[0], @"[A-Z]").Count==1)
                {             
                    var encryptedInfo = Encrypt(input);
                    Console.WriteLine($"Successful encryption: {encryptedInfo}");
                }
                else
                {
                    Console.WriteLine($"Invalid input!");
                }
                input = Console.ReadLine();
            }
        }
        private static string Encrypt(string text)
        {
            int key = text.Split(':')[0].Length;
            StringBuilder inputAsSb = new StringBuilder();
            for (int i = 0; i < text.Length; i++)
            {
                inputAsSb.Append(text[i]);
            }
            for (int j = 0; j < inputAsSb.Length; j++)
            {
                if (inputAsSb[j] != ' ' && inputAsSb[j] != 39)                
                {
                    if (inputAsSb[j] == ':')
                    {
                        inputAsSb[j] = '@';
                    }
                    else
                    {
                        if (inputAsSb[j] >= 65 && inputAsSb[j] <= 90)
                        {
                            if (inputAsSb[j] + key > 90)
                            {
                                inputAsSb[j] = (char)(inputAsSb[j] + key - 26);
                            }
                            else
                            {
                                inputAsSb[j] = (char)(inputAsSb[j] + key);
                            }
                        }
                        if (inputAsSb[j] >= 97 && inputAsSb[j] <= 122)
                        {
                            if (inputAsSb[j] + key > 122)
                            {
                                inputAsSb[j] = (char)(inputAsSb[j] + key - 26);
                            }
                            else
                            {
                                inputAsSb[j] = (char)(inputAsSb[j] + key);
                            }
                        }
                    }
                }
            }
            return inputAsSb.ToString();
        }
    }
}